ember-testem 0.6.0 → 1.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md
CHANGED
|
@@ -5,20 +5,20 @@ _Backward- and forward-compatible testing for Ember projects_
|
|
|
5
5
|
|
|
6
6
|
## Why?
|
|
7
7
|
|
|
8
|
-
Until now, testing Ember apps and addons required `ember-cli`, a monolith package that is written in JavaScript and has
|
|
8
|
+
Until now, testing Ember apps and addons required `ember-cli`, a monolith package that is written in JavaScript and has less relevance in v2 apps and v2 addons. Production projects may be at risk because tools like `ember-exam` and `@percy/ember` are built on `ember-cli`.
|
|
9
9
|
|
|
10
|
-
`ember-testem`
|
|
11
|
-
|
|
12
|
-
- The fix is minimal, backward-, and forward-compatible (apps with strict resolver, apps without `ember-cli`).
|
|
13
|
-
- We can keep using `qunit` and `testem`. No need to switch to another test framework and rewrite tests.
|
|
14
|
-
- We can keep using battle-tested packages like `@embroider/try`, `@percy/ember`, `ember-a11y-testing`, `ember-qunit`, `ember-test-selectors`, `miragejs`, and `qunit-dom`.
|
|
10
|
+
`ember-testem` is a CLI that allows you to keep running tests with `qunit` and `testem`.
|
|
15
11
|
|
|
16
12
|
|
|
17
13
|
## Quickstart
|
|
18
14
|
|
|
19
15
|
> [!TIP]
|
|
20
16
|
>
|
|
21
|
-
> From the root of your Ember app or addon, run `
|
|
17
|
+
> From the root of your Ember app or addon, run `install-ember-testem` to set up `ember-testem`.
|
|
18
|
+
>
|
|
19
|
+
> ```sh
|
|
20
|
+
> pnpx install-ember-testem
|
|
21
|
+
> ```
|
|
22
22
|
|
|
23
23
|
1\. Install `ember-testem` as a development dependency. The package provides an executable named `ember-test`.
|
|
24
24
|
|
|
@@ -118,9 +118,11 @@ See [my-v1-app](../../tests/my-v1-app) for an example.
|
|
|
118
118
|
|
|
119
119
|
<summary>V2 addons</summary>
|
|
120
120
|
|
|
121
|
+
See [my-v2-addon](../../tests/my-v2-addon) for an example.
|
|
122
|
+
|
|
121
123
|
In general, I recommend creating a test app as a separate package (using workspaces). This way, you can separate dependencies for source code and testing (avoid past issues with v1 addons). You would set up `ember-testem` by following the steps for v2 apps.
|
|
122
124
|
|
|
123
|
-
If you still want to create the test app in the same package, you will need to install and configure additional dependencies.
|
|
125
|
+
If you still want to create the test app in the same package, you will need to install and configure additional dependencies. You can use `install-ember-testem` to get started.
|
|
124
126
|
|
|
125
127
|
```json
|
|
126
128
|
{
|
|
@@ -131,13 +133,6 @@ If you still want to create the test app in the same package, you will need to i
|
|
|
131
133
|
}
|
|
132
134
|
```
|
|
133
135
|
|
|
134
|
-
Files that need changes:
|
|
135
|
-
|
|
136
|
-
- Babel (`babel.test.config.mjs`)
|
|
137
|
-
- Dependencies (`package.json`)
|
|
138
|
-
- TypeScript (`tsconfig.json`, `tsconfig.build.json`)
|
|
139
|
-
- Vite (`vite.test.config.mts`)
|
|
140
|
-
|
|
141
136
|
</details>
|
|
142
137
|
|
|
143
138
|
<details>
|
|
@@ -228,7 +223,7 @@ ember-test --path dist-for-testing
|
|
|
228
223
|
|
|
229
224
|
By default, `ember-testem` runs tests on port `7357`.
|
|
230
225
|
|
|
231
|
-
Pass `--port`
|
|
226
|
+
Pass `--port` to pick a different port. You can pass `0` to pick any available port (useful for testing multiple projects in parallel).
|
|
232
227
|
|
|
233
228
|
```sh
|
|
234
229
|
ember-test --port 0
|
|
@@ -263,7 +258,7 @@ ember-test --random gflqlwrm59j
|
|
|
263
258
|
|
|
264
259
|
## Compatibility
|
|
265
260
|
|
|
266
|
-
- Node.js v22
|
|
261
|
+
- Node.js v22 or above
|
|
267
262
|
|
|
268
263
|
|
|
269
264
|
## Contributing
|
package/dist/bin/ember-test.js
CHANGED
|
@@ -39,15 +39,10 @@ const argv = yargs(hideBin(process.argv))
|
|
|
39
39
|
describe: 'Launch test browser',
|
|
40
40
|
type: 'boolean',
|
|
41
41
|
})
|
|
42
|
-
.option('test-port', {
|
|
43
|
-
describe: 'Port for running tests. Pass 0 to automatically pick an available port.',
|
|
44
|
-
type: 'number',
|
|
45
|
-
})
|
|
46
|
-
.deprecateOption('test-port', 'Use --port instead.')
|
|
47
42
|
.parseSync();
|
|
48
43
|
const codemodOptions = {
|
|
49
44
|
buildPath: argv['path'],
|
|
50
|
-
port: argv['
|
|
45
|
+
port: argv['port'],
|
|
51
46
|
projectRoot: argv['root'] ?? process.cwd(),
|
|
52
47
|
qunit: {
|
|
53
48
|
filter: argv['filter'],
|
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
export function getQueryParams(options) {
|
|
2
2
|
const { qunit } = options;
|
|
3
3
|
const params = [];
|
|
4
|
-
if (qunit.module) {
|
|
5
|
-
params.push(`module=${qunit.module}`);
|
|
6
|
-
}
|
|
7
4
|
if (qunit.filter) {
|
|
8
5
|
params.push(`filter=${qunit.filter}`);
|
|
9
6
|
}
|
|
7
|
+
if (qunit.module) {
|
|
8
|
+
params.push(`module=${qunit.module}`);
|
|
9
|
+
}
|
|
10
10
|
if (qunit.seed) {
|
|
11
11
|
params.push(`seed=${qunit.seed}`);
|
|
12
12
|
}
|
|
13
|
-
return params.join('&');
|
|
13
|
+
return params.sort().join('&');
|
|
14
14
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "ember-testem",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "1.0.0",
|
|
4
4
|
"description": "Backward- and forward-compatible testing for Ember projects",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"ci",
|
|
@@ -30,21 +30,21 @@
|
|
|
30
30
|
"yargs": "^18.2.0"
|
|
31
31
|
},
|
|
32
32
|
"devDependencies": {
|
|
33
|
-
"@codemod-utils/tests": "^3.
|
|
33
|
+
"@codemod-utils/tests": "^3.5.0",
|
|
34
34
|
"@shared-configs/eslint-config-node": "0.0.0",
|
|
35
35
|
"@shared-configs/prettier": "0.0.0",
|
|
36
36
|
"@shared-configs/typescript": "0.0.0",
|
|
37
37
|
"@types/node": "^22.20.5",
|
|
38
38
|
"@types/sinon": "^22.0.2",
|
|
39
39
|
"@types/yargs": "^17.0.35",
|
|
40
|
-
"concurrently": "^10.0.
|
|
41
|
-
"eslint": "^10.
|
|
42
|
-
"prettier": "^3.
|
|
40
|
+
"concurrently": "^10.0.7",
|
|
41
|
+
"eslint": "^10.15.0",
|
|
42
|
+
"prettier": "^3.10.1",
|
|
43
43
|
"sinon": "^22.1.0",
|
|
44
44
|
"typescript": "^6.0.3"
|
|
45
45
|
},
|
|
46
46
|
"engines": {
|
|
47
|
-
"node": "
|
|
47
|
+
"node": "22.* || >= 24"
|
|
48
48
|
},
|
|
49
49
|
"scripts": {
|
|
50
50
|
"build": "sh build.sh --production",
|