Skip to content

Conversation

JakobJingleheimer
Copy link
Member

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%).

@nodejs-github-bot nodejs-github-bot added esm Issues and PRs related to the ECMAScript Modules implementation. needs-ci PRs that need a full CI run. test Issues and PRs related to the tests. labels Nov 9, 2023
@JakobJingleheimer JakobJingleheimer force-pushed the test/modernise-old-esm-tests branch from 7df3076 to 44abe5b Compare November 9, 2023 17:21
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');
}
Copy link
Contributor

Choose a reason for hiding this comment

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

Let's use assert.throws, no?

This was referenced Aug 13, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

esm Issues and PRs related to the ECMAScript Modules implementation. needs-ci PRs that need a full CI run. test Issues and PRs related to the tests.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants