@brightspace-ui/testing 1.24.0 → 1.24.1
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/package.json +1 -1
- package/src/server/wtr-config.js +31 -3
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.24.
|
|
5
|
+
"version": "1.24.1",
|
|
6
6
|
"repository": "https://github.com/BrightspaceUI/testing.git",
|
|
7
7
|
"scripts": {
|
|
8
8
|
"lint": "npm run lint:eslint && npm run lint:style",
|
package/src/server/wtr-config.js
CHANGED
|
@@ -6,6 +6,36 @@ import { reporter as testReportingReporter } from 'd2l-test-reporting/reporters/
|
|
|
6
6
|
import { visualDiff } from './visual-diff-plugin.js';
|
|
7
7
|
import { visualDiffReporter } from './visual-diff-reporter.js';
|
|
8
8
|
|
|
9
|
+
const defaultReporterGrep = () => {
|
|
10
|
+
const dr = defaultReporter();
|
|
11
|
+
const removeGrepFailures = results => {
|
|
12
|
+
let passed = true;
|
|
13
|
+
results.tests?.forEach(test => {
|
|
14
|
+
if (!test.passed) {
|
|
15
|
+
if (!test.error) {
|
|
16
|
+
test.skipped = true;
|
|
17
|
+
} else {
|
|
18
|
+
passed = false;
|
|
19
|
+
}
|
|
20
|
+
}
|
|
21
|
+
});
|
|
22
|
+
|
|
23
|
+
results.suites?.forEach(suite => removeGrepFailures(suite));
|
|
24
|
+
return passed;
|
|
25
|
+
};
|
|
26
|
+
|
|
27
|
+
return { ...dr,
|
|
28
|
+
getTestProgress({ sessions, ...others }) {
|
|
29
|
+
sessions.forEach(session => {
|
|
30
|
+
if (session.testResults) {
|
|
31
|
+
session.passed = removeGrepFailures(session.testResults) && !session.errors.length;
|
|
32
|
+
}
|
|
33
|
+
});
|
|
34
|
+
return dr.getTestProgress({ sessions, ...others });
|
|
35
|
+
}
|
|
36
|
+
};
|
|
37
|
+
};
|
|
38
|
+
|
|
9
39
|
const DEFAULT_PATTERN = type => `./test/**/*.${type}.js`;
|
|
10
40
|
const DEFAULT_TEST_REPORTING = !!env['CI'];
|
|
11
41
|
const BROWSER_MAP = {
|
|
@@ -220,9 +250,7 @@ export class WTRConfig {
|
|
|
220
250
|
});
|
|
221
251
|
}
|
|
222
252
|
|
|
223
|
-
|
|
224
|
-
config.reporters ??= [ defaultReporter() ];
|
|
225
|
-
}
|
|
253
|
+
config.reporters ??= [ defaultReporterGrep() ];
|
|
226
254
|
|
|
227
255
|
if (group === 'test') {
|
|
228
256
|
config.groups.push({
|