You can exclude files in mocha by passing options
mocha -h|grep -i exclude --exclude <file> a file or glob pattern to ignore (default: ) mocha --exclude **/*-.jest.js
Alternatively, you can also create a test/mocha.opts and add it there.
# test/mocha.opts --exclude **/*-test.jest.js --require ./test/setup.js
If you want to exclude a specific file type, you can do something like this
// test/setup.js require.extensions['.graphql'] = function() { return null }
This is useful when handling extensions with a module loader such as a web package that mocha does not understand.
lfender6445
source share