Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

tns test does not work with mocha 1.3+ #2212

Closed
dtopuzov opened this issue Nov 10, 2016 · 3 comments
Closed

tns test does not work with mocha 1.3+ #2212

dtopuzov opened this issue Nov 10, 2016 · 3 comments

Comments

@dtopuzov
Copy link
Contributor

tns create TestApp && cd TestApp
tns test init --framework mocha
tns test android

Result:

module.js:471
    throw err;
    ^

Error: Cannot find module 'mocha'
    at Function.Module._resolveFilename (module.js:469:15)
    at Function.resolve (internal/module.js:27:19)
    at initMocha (/Users/topuzov/Git/nativescript-cli-tests/TNS_App/node_modules/karma-mocha/lib/index.js:10:40)
    at Array.invoke (/Users/topuzov/Git/nativescript-cli-tests/TNS_App/node_modules/karma/node_modules/di/lib/injector.js:75:15)
    at Injector.get (/Users/topuzov/Git/nativescript-cli-tests/TNS_App/node_modules/karma/node_modules/di/lib/injector.js:48:43)
    at /Users/topuzov/Git/nativescript-cli-tests/TNS_App/node_modules/karma/lib/server.js:143:20
    at Array.forEach (native)
    at Server._start (/Users/topuzov/Git/nativescript-cli-tests/TNS_App/node_modules/karma/lib/server.js:142:21)
    at Injector.invoke (/Users/topuzov/Git/nativescript-cli-tests/TNS_App/node_modules/karma/node_modules/di/lib/injector.js:75:15)
    at Server.start (/Users/topuzov/Git/nativescript-cli-tests/TNS_App/node_modules/karma/lib/server.js:103:18)
    at process.<anonymous> (/Users/topuzov/Git/nativescript-cli-tests/node_modules/nativescript/lib/services/karma-execution.js:8:15)
    at emitTwo (events.js:106:13)
    at process.emit (events.js:191:7)
    at process.nextTick (internal/child_process.js:744:12)
    at _combinedTickCallback (internal/process/next_tick.js:67:7)
    at process._tickCallback (internal/process/next_tick.js:98:9)
Error: Test run failed.
    at FiberFuture.wait (/Users/topuzov/Git/nativescript-cli-tests/node_modules/fibers/future.js:566:15)
    at /Users/topuzov/Git/nativescript-cli-tests/node_modules/nativescript/lib/common/errors.js:128:33
    at Function.settle (/Users/topuzov/Git/nativescript-cli-tests/node_modules/fibers/future.js:249:26)
    at FiberFuture.wait (/Users/topuzov/Git/nativescript-cli-tests/node_modules/fibers/future.js:565:10)
    at /Users/topuzov/Git/nativescript-cli-tests/node_modules/nativescript/lib/common/services/commands-service.js:84:106
    at Function.settle (/Users/topuzov/Git/nativescript-cli-tests/node_modules/fibers/future.js:249:26)
    at FiberFuture.wait (/Users/topuzov/Git/nativescript-cli-tests/node_modules/fibers/future.js:565:10)
    at /Users/topuzov/Git/nativescript-cli-tests/node_modules/nativescript/lib/common/yok.js:208:124
    at Function.settle (/Users/topuzov/Git/nativescript-cli-tests/node_modules/fibers/future.js:249:26)
    at FiberFuture.wait (/Users/topuzov/Git/nativescript-cli-tests/node_modules/fibers/future.js:565:10)
    at /Users/topuzov/Git/nativescript-cli-tests/node_modules/nativescript/lib/common/services/commands-service.js:51:55
    at Function.settle (/Users/topuzov/Git/nativescript-cli-tests/node_modules/fibers/future.js:249:26)
    at FiberFuture.wait (/Users/topuzov/Git/nativescript-cli-tests/node_modules/fibers/future.js:565:10)
    at /Users/topuzov/Git/nativescript-cli-tests/node_modules/nativescript/lib/common/errors.js:128:33
    at Function.settle (/Users/topuzov/Git/nativescript-cli-tests/node_modules/fibers/future.js:249:26)
    at FiberFuture.wait (/Users/topuzov/Git/nativescript-cli-tests/node_modules/fibers/future.js:565:10)
    - - - - -
    at ChildProcess.<anonymous> (/Users/topuzov/Git/nativescript-cli-tests/node_modules/nativescript/lib/services/test-execution-service.js:111:33)
    at emitTwo (events.js:106:13)
    at ChildProcess.emit (events.js:191:7)
    at Process.ChildProcess._handle.onexit (internal/child_process.js:215:12)

Workaround:

tns create TestApp && cd TestApp
tns test init --framework mocha
npm install --save-dev mocha
tns test android
@tzraikov tzraikov added the bug label Nov 15, 2016
@dtopuzov
Copy link
Contributor Author

Same for jasmine, you should manually install jasmine-core

npm install --save-dev jasmine-core

@vchimev
Copy link

vchimev commented Jan 23, 2017

+ you'd need to install chai: npm install --save-dev chai

@pkoleva pkoleva modified the milestone: 2.6.0 (TBD) Jan 26, 2017
@dtopuzov
Copy link
Contributor Author

dtopuzov commented Apr 25, 2017

Duplicate of #2283

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

5 participants