I'm trying to test a meteor app like in the angular tutorial in meteor's website http://ift.tt/1qs6aL0
But when I add the import line
import { Meteor } from 'meteor/meteor';
and I run meteor test, I get this error:
W20160405-15:13:36.894(0)? (STDERR)
W20160405-15:13:36.894(0)? (STDERR) C:\Users\ys\AppData\Local\.meteor\packages\meteor-tool\1.3.1-rc.3\mt-os.windows.x86_32\dev_bundle\server-lib\node_modules\fibers\future.js:245
W20160405-15:13:36.895(0)? (STDERR) throw(ex);
W20160405-15:13:36.895(0)? (STDERR) ^
W20160405-15:13:36.895(0)? (STDERR) ReferenceError: require is not defined
W20160405-15:13:36.896(0)? (STDERR) at app\testing\add.test.js:5:21
W20160405-15:13:36.896(0)? (STDERR) at app\testing\add.test.js:21:4
W20160405-15:13:36.896(0)? (STDERR) at C:\Users\ys\AppData\Local\Temp\meteor-test-runxjisnu\.meteor\local\build\programs\server\boot.js:283:10
W20160405-15:13:36.896(0)? (STDERR) at Array.forEach (native)
=> Exited with code: 8
=> Your application is crashing. Waiting for file change.
W20160405-15:13:36.896(0)? (STDERR) at Function._.each._.forEach (C:\Users\ys\AppData\Local\.meteor\packages\meteor-tool\1.3.1-rc.3\mt-os.windows.x86_32\dev_bundle\server-lib\node_modules\underscore\underscore.js:79:11)
W20160405-15:13:36.897(0)? (STDERR) at C:\Users\ys\AppData\Local\Temp\meteor-test-runxjisnu\.meteor\local\build\programs\server\boot.js:133:5
When I remove the import line, the test runs as it should, but without importing "chai" (or similar module) , I don't know how to get the assert function to work.
Aucun commentaire:
Enregistrer un commentaire