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

Simplify testing situation to assure import and require works #59

Merged
merged 1 commit into from
Jan 22, 2024

Conversation

NullVoxPopuli
Copy link
Contributor

@NullVoxPopuli NullVoxPopuli commented Jan 2, 2024

Now we don't have duplication.

in a previous attempt

The only thing we need to remember is that we can't directly require or import in module-space in the tests themselves 😅

image

@NullVoxPopuli NullVoxPopuli marked this pull request as draft January 2, 2024 23:00
@NullVoxPopuli NullVoxPopuli marked this pull request as ready for review January 2, 2024 23:06
@ef4
Copy link
Collaborator

ef4 commented Jan 21, 2024

I don't think this is worth it. There's no reason to think the details of the API would be different between import and require. It's enough to write the tests one way (probably import) and then have a single test that does a require and invokes one of the functions to make sure it's really there.

@NullVoxPopuli NullVoxPopuli changed the title Combine tests, authoring them once, and testing against both ESM and CJS Simplify testing situation to assure import and require works Jan 22, 2024
@mansona
Copy link
Member

mansona commented Jan 22, 2024

Copy link
Collaborator

@ef4 ef4 left a comment

Choose a reason for hiding this comment

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

Looks good, once CI is sorted.

@NullVoxPopuli
Copy link
Contributor Author

it's sorted

@NullVoxPopuli NullVoxPopuli merged commit 203564e into main Jan 22, 2024
1 check passed
@NullVoxPopuli NullVoxPopuli deleted the combine-tests branch January 22, 2024 15:12
@github-actions github-actions bot mentioned this pull request Jan 22, 2024
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.

3 participants