Draft
Conversation
7df3076 to
44abe5b
Compare
aduh95
reviewed
Nov 9, 2023
Comment on lines
+48
to
+56
| try { | ||
| require('../fixtures/es-modules/package-type-module/index.js'); | ||
| assert.fail('Expected CJS to fail loading from type: module package.'); | ||
| } catch (e) { | ||
| assert.match(e.toString(), /require\(\) of ES Module/g); | ||
| assert.match(e.message, /require\(\) of ES Module/g); | ||
| assert.strictEqual(e.code, 'ERR_REQUIRE_ESM'); | ||
| assert.strictEqual(e.name, 'Error'); | ||
| } |
Contributor
There was a problem hiding this comment.
Let's use assert.throws, no?
This was referenced Aug 13, 2024
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
My goal is to improve DX and performance. The way old tests were written makes them very difficult to figure out what they're even asserting and, when they're failing, why.
Converting them to node's test runner in concurrent mode should on its own improve run-time (the first test I ported, which is quite a small test, improved its run-time by ~10%).