ember-testem 0.3.1 → 0.3.3

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
@@ -95,9 +95,9 @@ See [my-v1-app](../../tests/my-v1-app) for an example.
95
95
 
96
96
  <summary>V2 addons</summary>
97
97
 
98
- See [my-v2-addon](../../tests/my-v2-addon) for an example.
98
+ 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.
99
99
 
100
- For brevity, additional file changes aren't shown below. For example, you will need to split the Babel and TypeScript configurations into two files: one for production and another for testing.
100
+ If you still want to create the test app in the same package, you will need to install and configure additional dependencies. See [my-v2-addon](../../tests/my-v2-addon) for an example.
101
101
 
102
102
  ```json
103
103
  {
@@ -108,32 +108,13 @@ For brevity, additional file changes aren't shown below. For example, you will n
108
108
  }
109
109
  ```
110
110
 
111
- ```ts
112
- /* vite.test.config.mts */
113
- import { extensions, ember } from '@embroider/vite';
114
- import { babel } from '@rollup/plugin-babel';
115
- import { defineConfig } from 'vite';
111
+ Files that need changes:
116
112
 
117
- export default defineConfig({
118
- build: {
119
- minify: false,
120
- rollupOptions: {
121
- input: {
122
- tests: 'tests/index.html',
123
- },
124
- },
125
- sourcemap: true,
126
- },
127
- plugins: [
128
- ember(),
129
- babel({
130
- babelHelpers: 'inline',
131
- extensions,
132
- parallel: true,
133
- }),
134
- ],
135
- });
136
- ```
113
+ - Babel (`babel.config.mjs`, `babel.build.config.mjs`)
114
+ - Dependencies (`package.json`)
115
+ - Rollup (`rollup.config.mjs`)
116
+ - TypeScript (`tsconfig.json`, `tsconfig.build.json`)
117
+ - Vite (`vite.test.config.mts`)
137
118
 
138
119
  </details>
139
120
 
@@ -237,7 +218,7 @@ ember-test --port 0
237
218
  >
238
219
  > `ember-testem` provides a limited API on purpose.
239
220
  >
240
- > For `ember-cli` options like `--host`, `--launch`, `--reporter`, `--ssl`, `--ssl-cert`, `--ssl-key`, `--test-page`, `--testem-debug`), [configure `testem` in `testem.mjs` instead](https://github.com/ember-cli/ember-cli/blob/v7.3.0-ember-cli/lib/tasks/test.js#L54-L71).
221
+ > For `ember-cli` options like `--host`, `--launch`, `--query`, `--reporter`, `--ssl`, `--ssl-cert`, `--ssl-key`, `--test-page`, `--testem-debug`), [configure `testem` in `testem.mjs` instead](https://github.com/ember-cli/ember-cli/blob/v7.3.0-ember-cli/lib/tasks/test.js#L54-L71).
241
222
 
242
223
 
243
224
  ## Compatibility
@@ -43,12 +43,12 @@ const argv = yargs(hideBin(process.argv))
43
43
  .parseSync();
44
44
  const codemodOptions = {
45
45
  buildPath: argv['path'],
46
- filters: {
47
- filter: argv['filter'],
48
- module: argv['module'],
49
- },
50
46
  port: argv['test-port'] ?? argv['port'],
51
47
  projectRoot: argv['root'] ?? process.cwd(),
48
+ qunit: {
49
+ filter: argv['filter'],
50
+ testModule: argv['module'],
51
+ },
52
52
  server: argv['server'],
53
53
  };
54
54
  void run(codemodOptions);
@@ -1,10 +1,10 @@
1
1
  export function createOptions(codemodOptions) {
2
- const { buildPath, filters, port, projectRoot, server } = codemodOptions;
2
+ const { buildPath, port, projectRoot, qunit, server } = codemodOptions;
3
3
  return {
4
4
  buildPath,
5
- filters,
6
5
  launchBrowser: Boolean(server),
7
6
  port,
8
7
  projectRoot,
8
+ qunit,
9
9
  };
10
10
  }
@@ -2,7 +2,7 @@ import { join } from 'node:path';
2
2
  import Testem from 'testem';
3
3
  import { getQueryParams } from '../../utils/run-tests/get-query-params.js';
4
4
  export async function runTestsInCI(options) {
5
- const { buildPath, filters, port, projectRoot } = options;
5
+ const { buildPath, port, projectRoot } = options;
6
6
  const testemInstance = new Testem();
7
7
  const startOptions = {
8
8
  launch: false,
@@ -13,7 +13,7 @@ export async function runTestsInCI(options) {
13
13
  config_dir: projectRoot,
14
14
  cwd: join(projectRoot, buildPath),
15
15
  parallel: 1,
16
- query_params: getQueryParams(filters),
16
+ query_params: getQueryParams(options),
17
17
  });
18
18
  return new Promise((resolve, reject) => {
19
19
  testemInstance.startCI(startOptions, (exitCode, error) => {
@@ -3,7 +3,7 @@ import { watch } from 'chokidar';
3
3
  import Testem from 'testem';
4
4
  import { getQueryParams } from '../../utils/run-tests/get-query-params.js';
5
5
  export async function runTestsInDev(options) {
6
- const { buildPath, filters, port, projectRoot } = options;
6
+ const { buildPath, port, projectRoot } = options;
7
7
  const testemInstance = new Testem();
8
8
  const startOptions = {
9
9
  launch: false,
@@ -13,7 +13,7 @@ export async function runTestsInDev(options) {
13
13
  ...startOptions,
14
14
  config_dir: projectRoot,
15
15
  cwd: join(projectRoot, buildPath),
16
- query_params: getQueryParams(filters),
16
+ query_params: getQueryParams(options),
17
17
  });
18
18
  const watcher = watch([buildPath], {
19
19
  awaitWriteFinish: true,
@@ -1,10 +1,11 @@
1
- export function getQueryParams(filters) {
1
+ export function getQueryParams(options) {
2
+ const { qunit } = options;
2
3
  const params = [];
3
- if (filters.module) {
4
- params.push(`module=${filters.module}`);
4
+ if (qunit.testModule) {
5
+ params.push(`module=${qunit.testModule}`);
5
6
  }
6
- if (filters.filter) {
7
- params.push(`filter=${filters.filter}`);
7
+ if (qunit.filter) {
8
+ params.push(`filter=${qunit.filter}`);
8
9
  }
9
10
  return params.join('&');
10
11
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "ember-testem",
3
- "version": "0.3.1",
3
+ "version": "0.3.3",
4
4
  "description": "Backward- and forward-compatible testing for Ember projects",
5
5
  "keywords": [
6
6
  "ci",
@@ -30,15 +30,15 @@
30
30
  "yargs": "^18.2.0"
31
31
  },
32
32
  "devDependencies": {
33
- "@codemod-utils/tests": "^3.3.0",
33
+ "@codemod-utils/tests": "^3.3.1",
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
- "@types/node": "^22.20.4",
37
+ "@types/node": "^22.20.5",
38
38
  "@types/yargs": "^17.0.35",
39
- "concurrently": "^10.0.5",
40
- "eslint": "^10.12.0",
41
- "prettier": "^3.9.9",
39
+ "concurrently": "^10.0.6",
40
+ "eslint": "^10.13.0",
41
+ "prettier": "^3.9.10",
42
42
  "typescript": "^6.0.3"
43
43
  },
44
44
  "engines": {