Fix "test.py -g Menu" not working
This commit is contained in:
parent
d7bc127c60
commit
2e3d940749
1 changed files with 3 additions and 2 deletions
|
@ -68,10 +68,11 @@
|
||||||
// npm run test -match=menu
|
// npm run test -match=menu
|
||||||
const moduleMatch = process.env.npm_config_match
|
const moduleMatch = process.env.npm_config_match
|
||||||
? new RegExp(process.env.npm_config_match, 'g')
|
? new RegExp(process.env.npm_config_match, 'g')
|
||||||
: /.*/gi
|
: null
|
||||||
|
|
||||||
walker.on('file', (file) => {
|
walker.on('file', (file) => {
|
||||||
if (/-spec\.js$/.test(file) && moduleMatch.test(file) && !file.includes(crashSpec)) {
|
if (/-spec\.js$/.test(file) && !file.includes(crashSpec) &&
|
||||||
|
(!moduleMatch || moduleMatch.test(file))) {
|
||||||
mocha.addFile(file)
|
mocha.addFile(file)
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue