-
-
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
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -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 commentThe reason will be displayed to describe this comment to others. Learn more. We can now use the latest versions of our test dependencies. |
||
"chai-as-promised": "^8.0.1", | ||
"codecov": "^3.8.3", | ||
"concurrently": "^9.1.0", | ||
"ember-cli": "~5.12.0", | ||
"eslint": "^8.57.0", | ||
"eslint-config-prettier": "^9.1.0", | ||
"eslint-plugin-n": "^17.15.0", | ||
"mocha": "^10.8.2", | ||
"mocha": "^11.0.1", | ||
"nyc": "^17.1.0", | ||
"prettier": "^3.3.3", | ||
"prettier": "^3.4.2", | ||
"release-it": "^17.10.0", | ||
"sinon": "^19.0.2", | ||
"tmp-sync": "^1.1.0" | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,14 +1,13 @@ | ||
'use strict'; | ||
|
||
let expect = require('chai').expect; | ||
let fs = require('fs-extra'); | ||
let path = require('path'); | ||
let tmp = require('tmp-sync'); | ||
let fixtureWorkspaces = require('../fixtures/package-with-workspaces.json'); | ||
let WorkspaceAdapter = require('../../lib/dependency-manager-adapters/workspace'); | ||
let writeJSONFile = require('../helpers/write-json-file'); | ||
let assertFileContainsJSON = require('../helpers/assert-file-contains-json'); | ||
let generateMockRun = require('../helpers/generate-mock-run'); | ||
import { expect } from 'chai'; | ||
import fs from 'fs-extra'; | ||
import path from 'path'; | ||
import tmp from 'tmp-sync'; | ||
import WorkspaceAdapter from '../../lib/dependency-manager-adapters/workspace.js'; | ||
import writeJSONFile from '../helpers/write-json-file.js'; | ||
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 commentThe 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" }; |
||
let root = process.cwd(); | ||
let tmproot = path.join(root, 'tmp'); | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,5 @@ | ||
'use strict'; | ||
import fs from 'fs-extra'; | ||
|
||
const fs = require('fs-extra'); | ||
|
||
module.exports = function writeJSONFile(filename, contents) { | ||
export default function writeJSONFile(filename, contents) { | ||
fs.writeFileSync(filename, JSON.stringify(contents, null, 2)); | ||
}; | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
{ | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Less work than renaming all files to |
||
"description": "This `package.json` file solely exists to use ES modules in the test suite.", | ||
"name": "test", | ||
"private": true, | ||
"type": "module" | ||
} |
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 thetest
folder. Can probably be deleted once we use"type": "module"
in the rootpackage.json
file.