-
-
Notifications
You must be signed in to change notification settings - Fork 58
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
Migrate test suite to ES modules #1034
Migrate test suite to ES modules #1034
Conversation
@@ -4,6 +4,10 @@ module.exports = { | |||
{ | |||
env: { mocha: true }, | |||
files: ['test/**/*.js'], | |||
parserOptions: { sourceType: 'module' }, | |||
rules: { | |||
'n/no-extraneous-import': 'off', |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I assume because we use a "fake" package.json
file to force ES modules for the test
folder. Can probably be deleted once we use "type": "module"
in the root package.json
file.
@@ -51,17 +51,17 @@ | |||
"@babel/core": "^7.26.0", | |||
"@babel/eslint-parser": "^7.25.9", | |||
"@release-it-plugins/lerna-changelog": "^7.0.0", | |||
"chai": "^4.4.1", | |||
"chai-as-promised": "^7.1.1", | |||
"chai": "^5.1.2", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We can now use the latest versions of our test dependencies.
import assertFileContainsJSON from '../helpers/assert-file-contains-json.js'; | ||
import generateMockRun from '../helpers/generate-mock-run.js'; | ||
|
||
const fixtureWorkspaces = fs.readJsonSync('./test/fixtures/package-with-workspaces.json'); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can be reverted to an import once we can use import attributes:
import data from "https://example.com/data.json" with { type: "json" };
@@ -0,0 +1,6 @@ | |||
{ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Less work than renaming all files to .mjs
and back again to .js
.
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #1034 +/- ##
=======================================
Coverage 95.55% 95.55%
=======================================
Files 22 22
Lines 518 518
=======================================
Hits 495 495
Misses 23 23 ☔ View full report in Codecov by Sentry. |
No description provided.