Fix "test.py -g Menu" not working

This commit is contained in:
Cheng Zhao 2018-01-01 15:46:39 +09:00
parent d7bc127c60
commit 2e3d940749

View file

@ -68,10 +68,11 @@
// npm run test -match=menu
const moduleMatch = process.env.npm_config_match
? new RegExp(process.env.npm_config_match, 'g')
: /.*/gi
: null
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)
}
})