Skip to content

Commit 5263ad3

Browse files
committedNov 11, 2023
Sync node-test-runner plugin entry patterns
1 parent 0451e23 commit 5263ad3

File tree

3 files changed

+9
-14
lines changed

3 files changed

+9
-14
lines changed
 

‎src/plugins/node-test-runner/README.md

+1-6
Original file line numberDiff line numberDiff line change
@@ -9,12 +9,7 @@ This plugin is enabled when any script in `package.json` includes `node --test`
99
```json
1010
{
1111
"node-test-runner": {
12-
"entry": [
13-
"**/test.{js,cjs,mjs}",
14-
"**/test-*.{js,cjs,mjs}",
15-
"**/*{.,-,_}test.{js,cjs,mjs}",
16-
"**/test/**/*.{js,cjs,mjs}"
17-
]
12+
"entry": ["**/*{.,-,_}test.?(c|m)js", "**/test-*.?(c|m)js", "**/test.?(c|m)js", "**/test/**/*.?(c|m)js"]
1813
}
1914
}
2015
```

‎src/plugins/node-test-runner/index.ts

+4-4
Original file line numberDiff line numberDiff line change
@@ -18,10 +18,10 @@ export const isEnabled: IsPluginEnabledCallback = ({ manifest }) => {
1818

1919
/** @public */
2020
export const ENTRY_FILE_PATTERNS = [
21-
'**/test.{js,cjs,mjs}',
22-
'**/test-*.{js,cjs,mjs}',
23-
'**/*{.,-,_}test.{js,cjs,mjs}',
24-
'**/test/**/*.{js,cjs,mjs}',
21+
'**/*{.,-,_}test.?(c|m)js',
22+
'**/test-*.?(c|m)js',
23+
'**/test.?(c|m)js',
24+
'**/test/**/*.?(c|m)js',
2525
];
2626

2727
const findNodeTestRunnerDependencies: GenericPluginCallback = async (configFilePath, options) => {

‎test/plugins/node-test-runner.test.ts

+4-4
Original file line numberDiff line numberDiff line change
@@ -11,9 +11,9 @@ test('Find dependencies in node-test-runner configuration (json)', async () => {
1111
const configFilePath = join(cwd, 'package.json');
1212
const dependencies = await nodeTestRunner.findDependencies(configFilePath, { manifest });
1313
assert.deepEqual(dependencies, [
14-
'entry:**/test.{js,cjs,mjs}',
15-
'entry:**/test-*.{js,cjs,mjs}',
16-
'entry:**/*{.,-,_}test.{js,cjs,mjs}',
17-
'entry:**/test/**/*.{js,cjs,mjs}',
14+
'entry:**/*{.,-,_}test.?(c|m)js',
15+
'entry:**/test-*.?(c|m)js',
16+
'entry:**/test.?(c|m)js',
17+
'entry:**/test/**/*.?(c|m)js',
1818
]);
1919
});

0 commit comments

Comments
 (0)
Please sign in to comment.