You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Dec 28, 2023. It is now read-only.
I wan't to specify which files are my test files with the following pattern: test/**/*spec.js. Since I run my tests with nodejs using mocha from command line and using karma start tdd.karma.conf.js --single-run, I thought it would be best to put this info into the mocha.opts file, so it would be loaded by both the nodejs version and the browserified version, which is used by karma.
I use karma with the following config file currently:
So by starting the karma server with karma start tdd.karma.conf.js I will be able to develop and run the tests automatically with watch and by starting with karma start tdd.karma.conf.js --single-run I will be able to automatically test in a pre-commit hook to prevent committing code which does not pass the tests.
By putting test/**/*spec.js into the mocha.opts it runs properly with nodejs, but I got the following error with karma:
PhantomJS 1.9.8 (Windows 7 0.0.0) ERROR
ReferenceError: Can't find variable: test
at D:/creation/software developer/projects/javascript-project-template/test/mocha.opts:1
By putting "test/**/*spec.js" into the mocha.opts it runs properly with karma, but I got the following error with nodejs:
D:\creation\software developer\projects\javascript-project-template\node_modules\mocha\lib\utils.js:628
throw new Error("cannot resolve path (or pattern) '" + path + "'");
^
Error: cannot resolve path (or pattern) '"test/**/*spec.js"'
at Object.lookupFiles (D:\creation\software developer\projects\javascript-project-template\node_modules\mocha\lib\utils.js:628:15)
at D:\creation\software developer\projects\javascript-project-template\node_modules\mocha\bin\_mocha:326:30
at Array.forEach (native)
at Object.<anonymous> (D:\creation\software developer\projects\javascript-project-template\node_modules\mocha\bin\_mocha:325:6)
at Module._compile (module.js:435:26)
at Object.Module._extensions..js (module.js:442:10)
at Module.load (module.js:356:32)
at Function.Module._load (module.js:311:12)
at Function.Module.runMain (module.js:467:10)
at startup (node.js:134:18)
at node.js:961:3
So the mocha.opts is not processed properly by using it with karma-mocha. Is there a way to workaround this issue until it is fixed, e.g. by giving the mocha parameter in the karma config file?
The text was updated successfully, but these errors were encountered:
I wan't to specify which files are my test files with the following pattern:
test/**/*spec.js
. Since I run my tests with nodejs usingmocha
from command line and usingkarma start tdd.karma.conf.js --single-run
, I thought it would be best to put this info into themocha.opts
file, so it would be loaded by both the nodejs version and the browserified version, which is used by karma.I use karma with the following config file currently:
So by starting the karma server with
karma start tdd.karma.conf.js
I will be able to develop and run the tests automatically with watch and by starting withkarma start tdd.karma.conf.js --single-run
I will be able to automatically test in a pre-commit hook to prevent committing code which does not pass the tests.By putting
test/**/*spec.js
into themocha.opts
it runs properly with nodejs, but I got the following error with karma:By putting
"test/**/*spec.js"
into themocha.opts
it runs properly with karma, but I got the following error with nodejs:So the
mocha.opts
is not processed properly by using it withkarma-mocha
. Is there a way to workaround this issue until it is fixed, e.g. by giving the mocha parameter in the karma config file?The text was updated successfully, but these errors were encountered: