Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

adding setupSinon function to dummy/index.d.ts to allow for types in … #763

Merged
merged 4 commits into from
Mar 14, 2023

Conversation

robostheimer
Copy link
Contributor

…default import

All tests pass.
ember ts:precompile shows no errors.

@@ -1 +1,3 @@

declare module 'ember-sinon-qunit' {
export default function setupSinon(testEnvironment: Partial<QUnit>): void;
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This won't be a Partial anymore, right?

Copy link
Owner

@elwayman02 elwayman02 Mar 14, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actually, nvm, I think Partial is the right way to type it because they may in theory supply their own modified test environment with the same two methods to hook into.

Copy link
Contributor Author

@robostheimer robostheimer Mar 14, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In that case, I think that we’d want to with our own interface, given that we do not know for sure the their test environment is QUnit but we do know the methods they will be using.

interface TestEnvironmentInterface {
  testStart: (callback: () => void) => void
  testDone: (callback: () => void) => void
}

All that said the addon is called ember-sinon-qunit so aren’t we implying consumers will be using QUnit.

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think it's fine. If we run into a legit use-case, we can always go back and modify the types in a later release.

@elwayman02 elwayman02 merged commit f4839f5 into elwayman02:master Mar 14, 2023
@elwayman02 elwayman02 added the bug label Mar 14, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants