ember-testem 0.6.0 → 0.7.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 +12 -13
- package/dist/bin/ember-test.js +1 -6
- package/package.json +2 -2
package/README.md
CHANGED
|
@@ -5,20 +5,24 @@ _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
10
|
`ember-testem` aims to show that:
|
|
11
11
|
|
|
12
12
|
- The fix is minimal, backward-, and forward-compatible (apps with strict resolver, apps without `ember-cli`).
|
|
13
13
|
- We can keep using `qunit` and `testem`. No need to switch to another test framework and rewrite tests.
|
|
14
|
-
-
|
|
14
|
+
- It works with battle-tested packages like `@embroider/try`, `@percy/ember`, `ember-a11y-testing`, `ember-qunit`, `ember-test-selectors`, `miragejs`, and `qunit-dom`.
|
|
15
15
|
|
|
16
16
|
|
|
17
17
|
## Quickstart
|
|
18
18
|
|
|
19
19
|
> [!TIP]
|
|
20
20
|
>
|
|
21
|
-
> From the root of your Ember app or addon, run `
|
|
21
|
+
> From the root of your Ember app or addon, run `install-ember-testem` to set up `ember-testem`.
|
|
22
|
+
>
|
|
23
|
+
> ```sh
|
|
24
|
+
> pnpx install-ember-testem
|
|
25
|
+
> ```
|
|
22
26
|
|
|
23
27
|
1\. Install `ember-testem` as a development dependency. The package provides an executable named `ember-test`.
|
|
24
28
|
|
|
@@ -118,9 +122,11 @@ See [my-v1-app](../../tests/my-v1-app) for an example.
|
|
|
118
122
|
|
|
119
123
|
<summary>V2 addons</summary>
|
|
120
124
|
|
|
125
|
+
See [my-v2-addon](../../tests/my-v2-addon) for an example.
|
|
126
|
+
|
|
121
127
|
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
128
|
|
|
123
|
-
If you still want to create the test app in the same package, you will need to install and configure additional dependencies.
|
|
129
|
+
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
130
|
|
|
125
131
|
```json
|
|
126
132
|
{
|
|
@@ -131,13 +137,6 @@ If you still want to create the test app in the same package, you will need to i
|
|
|
131
137
|
}
|
|
132
138
|
```
|
|
133
139
|
|
|
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
140
|
</details>
|
|
142
141
|
|
|
143
142
|
<details>
|
|
@@ -228,7 +227,7 @@ ember-test --path dist-for-testing
|
|
|
228
227
|
|
|
229
228
|
By default, `ember-testem` runs tests on port `7357`.
|
|
230
229
|
|
|
231
|
-
Pass `--port`
|
|
230
|
+
Pass `--port` to pick a different port. You can pass `0` to pick any available port (useful for testing multiple projects in parallel).
|
|
232
231
|
|
|
233
232
|
```sh
|
|
234
233
|
ember-test --port 0
|
|
@@ -263,7 +262,7 @@ ember-test --random gflqlwrm59j
|
|
|
263
262
|
|
|
264
263
|
## Compatibility
|
|
265
264
|
|
|
266
|
-
- Node.js v22
|
|
265
|
+
- Node.js v22 or above
|
|
267
266
|
|
|
268
267
|
|
|
269
268
|
## 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'],
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "ember-testem",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.7.0",
|
|
4
4
|
"description": "Backward- and forward-compatible testing for Ember projects",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"ci",
|
|
@@ -44,7 +44,7 @@
|
|
|
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",
|