@brightspace-ui/testing 1.8.0 → 1.8.2
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 +16 -11
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.8.
|
|
5
|
+
"version": "1.8.2",
|
|
6
6
|
"repository": "https://github.com/BrightspaceUI/testing.git",
|
|
7
7
|
"scripts": {
|
|
8
8
|
"lint": "eslint . --ext .js",
|
package/src/server/wtr-config.js
CHANGED
|
@@ -40,6 +40,7 @@ export class WTRConfig {
|
|
|
40
40
|
|
|
41
41
|
get #defaultConfig() {
|
|
42
42
|
return {
|
|
43
|
+
browserStartTimeout: 60 * 1000,
|
|
43
44
|
groups: [],
|
|
44
45
|
nodeResolve: true,
|
|
45
46
|
testRunnerHtml: testFramework =>
|
|
@@ -54,7 +55,7 @@ export class WTRConfig {
|
|
|
54
55
|
}
|
|
55
56
|
|
|
56
57
|
get #pattern() {
|
|
57
|
-
const files = this.#cliArgs.files ||
|
|
58
|
+
const files = [ this.#cliArgs.files || this.pattern(this.#cliArgs.group), '!**/node_modules/**/*' ].flat();
|
|
58
59
|
|
|
59
60
|
if (this.#cliArgs.filter) {
|
|
60
61
|
return this.#filterFiles(files);
|
|
@@ -126,16 +127,20 @@ export class WTRConfig {
|
|
|
126
127
|
#filterFiles(files) {
|
|
127
128
|
return this.#cliArgs.filter.map(filterStr => {
|
|
128
129
|
// replace everything after the last forward slash
|
|
129
|
-
return files
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
130
|
+
return files
|
|
131
|
+
.filter(f => !f.startsWith('!')) // don't filter exclusions
|
|
132
|
+
.map(f => f.replace(/[^/]*$/, fileGlob => {
|
|
133
|
+
// create a new glob for each wildcard
|
|
134
|
+
const fileGlobs = Array.from(fileGlob.matchAll(/(?<!\*)\*(?!\*)/g)).map(({ index }) => {
|
|
135
|
+
const arr = fileGlob.split('');
|
|
136
|
+
arr.splice(index, 1, filterStr);
|
|
137
|
+
return arr.join('');
|
|
138
|
+
});
|
|
139
|
+
return `+(${fileGlobs.join('|') || fileGlob})`;
|
|
140
|
+
}));
|
|
141
|
+
})
|
|
142
|
+
.flat()
|
|
143
|
+
.concat(files.filter(f => f.startsWith('!')));
|
|
139
144
|
}
|
|
140
145
|
|
|
141
146
|
#getMochaConfig(group, slowConfig, timeoutConfig) {
|