I installed node-qunit (stable) from npm, but it may not seem like any tests are working. My source files do not seem to be included in scope.
./source/myscript.js:
var myObj = { a : true }
./test/tests.js:
test("that a is true", function () { ok(myObj.a); });
./test/runner.js:
var runner = require('qunit'); runner.run({ code : './source/myscript.js', tests : './test/tests.js' });
./Makefile:
test : <tab>node ./test/testrunner.js .PHONY: install test
If I run make test , I get the error 'ReferenceError: myObj is not defined' . The source file is launched because it can cause errors. It seems that it is simply not included in the global scope. This does not work if I do it from the command line according to the instructions in node-qunit readme . Does anyone know how to do this?
source share