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