@brightspace-ui/testing 1.40.0 → 1.42.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 +5 -5
- package/package.json +2 -2
- package/src/server/cli/test-runner.js +1 -1
- package/src/server/wtr-config.js +1 -1
package/README.md
CHANGED
|
@@ -424,7 +424,7 @@ Use the `d2l-test-runner` binary to execute a set of tests and report their resu
|
|
|
424
424
|
| timeout | `Number` | `2000` | Test timeout threshold in ms |
|
|
425
425
|
| filter | `String` | | Filter test files by replacing wildcards with this glob |
|
|
426
426
|
| grep | `String` | | Only run tests matching this string or regexp |
|
|
427
|
-
| files | `String` | `'
|
|
427
|
+
| files | `String` | `'./**/test/**/*.<group>.js'` | Test files to run. Path or glob. |
|
|
428
428
|
| config | `String` | `'./d2l-test-runner.config.js'` | Location of config file |
|
|
429
429
|
| watch | `Boolean` | `false` | Reload tests on file changes. Allows debugging in all browsers. |
|
|
430
430
|
| open | `Boolean` | `false` | Open the browser in headed mode |
|
|
@@ -461,9 +461,9 @@ export default {
|
|
|
461
461
|
|
|
462
462
|
Tests are organized into groups, which can be configured and run together.
|
|
463
463
|
|
|
464
|
-
The group name appears in the default `files` pattern (`'
|
|
464
|
+
The group name appears in the default `files` pattern (`'./**/test/**/*.<group>.js'`), making it typical for test files to have the group name as part of their extension. For example, the default group is `'test'` so all test files named `*.test.js` will belong to it by default. Similarly, the `vdiff` group contains files named `*.vdiff.js`.
|
|
465
465
|
|
|
466
|
-
To run tests which match the pattern `'
|
|
466
|
+
To run tests which match the pattern `'./**/test/**/*.mygroup.js'`:
|
|
467
467
|
```bash
|
|
468
468
|
d2l-test-runner --group mygroup
|
|
469
469
|
```
|
|
@@ -488,9 +488,9 @@ While writing or debugging tests, it can be desirable to focus the runner on a s
|
|
|
488
488
|
|
|
489
489
|
Use the `filter` option to filter by file name. It replaces any wildcards in the file name portion of the `files` pattern with the provided [glob](https://en.wikipedia.org/wiki/Glob_(programming)).
|
|
490
490
|
|
|
491
|
-
For example, with the `'test'` group and default pattern `'
|
|
491
|
+
For example, with the `'test'` group and default pattern `'./**/test/**/*.<group>.js'`, passing `d2l-test-runner --filter foo` will run tests which match `'./**/test/**/foo.test.js'`.
|
|
492
492
|
|
|
493
|
-
Wildcards can still be used but need to be escaped. So `d2l-test-runner --filter foo\*` will run tests which match `'
|
|
493
|
+
Wildcards can still be used but need to be escaped. So `d2l-test-runner --filter foo\*` will run tests which match `'./**/test/**/foo*.test.js'`.
|
|
494
494
|
|
|
495
495
|
### By Test Name
|
|
496
496
|
|
package/package.json
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
"name": "@brightspace-ui/testing",
|
|
3
3
|
"description": "Utilities for testing front-end components and applications",
|
|
4
4
|
"type": "module",
|
|
5
|
-
"version": "1.
|
|
5
|
+
"version": "1.42.0",
|
|
6
6
|
"repository": "https://github.com/BrightspaceUI/testing.git",
|
|
7
7
|
"scripts": {
|
|
8
8
|
"lint": "npm run lint:eslint && npm run lint:style",
|
|
@@ -26,7 +26,7 @@
|
|
|
26
26
|
"@brightspace-ui/stylelint-config": "^2",
|
|
27
27
|
"chai": "^6",
|
|
28
28
|
"eslint": "^9",
|
|
29
|
-
"eslint-config-brightspace": "^
|
|
29
|
+
"eslint-config-brightspace": "^3",
|
|
30
30
|
"globals": "^17",
|
|
31
31
|
"mocha": "^11",
|
|
32
32
|
"sinon": "^21",
|
|
@@ -16,7 +16,7 @@ async function getTestRunnerOptions(argv = []) {
|
|
|
16
16
|
name: 'files',
|
|
17
17
|
type: String,
|
|
18
18
|
multiple: true,
|
|
19
|
-
description: 'Test files to run. Path or glob.\n[Default:
|
|
19
|
+
description: 'Test files to run. Path or glob.\n[Default: ./**/test/**/*.<group>.js]',
|
|
20
20
|
order: 8
|
|
21
21
|
},
|
|
22
22
|
{
|
package/src/server/wtr-config.js
CHANGED
|
@@ -35,7 +35,7 @@ const defaultReporterGrep = () => {
|
|
|
35
35
|
};
|
|
36
36
|
};
|
|
37
37
|
|
|
38
|
-
const DEFAULT_PATTERN = type =>
|
|
38
|
+
const DEFAULT_PATTERN = type => `./**/test/**/*.${type}.js`;
|
|
39
39
|
const DEFAULT_TEST_REPORTING = !!env['CI'];
|
|
40
40
|
const BROWSER_MAP = {
|
|
41
41
|
chrome: 'chromium',
|