Skip to content
This repository has been archived by the owner on Jan 6, 2023. It is now read-only.

How to actually run the tests #32

Open
talamaska opened this issue Oct 6, 2015 · 2 comments
Open

How to actually run the tests #32

talamaska opened this issue Oct 6, 2015 · 2 comments

Comments

@talamaska
Copy link
Contributor

I have forked and cloned the repository on Windows machine. I tried to run the tests, but I'm failing on serve.spec.

Failures:

  1) Serve #loadSettings should parse out options from arg hash
   Message:
     Expected 'www\index.html' to be 'www/index.html'.
   Stacktrace:
     Error: Expected 'www\index.html' to be 'www/index.html'.
    at compareOptions (C:\server\www\ionic-app-lib\spec\serve.spec.js:42:30)
    at null.<anonymous> (C:\server\www\ionic-app-lib\spec\serve.spec.js:95:9)

  2) State should get the package json by app directory
   Message:
     Expected spy readInPackageJson to have been called with [ '/test/dev/ionic/package.json' ] but actual calls were [ '\test\dev\ionic\package.json' ]
   Stacktrace:
     Error: Expected spy readInPackageJson to have been called with [ '/test/dev/ionic/package.json' ] but actual calls were [ '\test\dev\ionic\package.json' ]
    at null.<anonymous> (C:\server\www\ionic-app-lib\spec\state.spec.js:24:37)

Finished in 2.009 seconds
167 tests, 296 assertions, 2 failures, 0 skipped



npm ERR! Windows_NT 6.3.9600
npm ERR! argv "C:\\Program Files\\nodejs\\\\node.exe" "C:\\Program Files\\nodejs\\node_modules\\npm\\bin\\npm-cli.js" "run" "jasmine"
npm ERR! node v0.12.4
npm ERR! npm  v2.10.1
npm ERR! code ELIFECYCLE
npm ERR! [email protected] jasmine: `jasmine-node --captureExceptions  ./spec`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the [email protected] jasmine script 'jasmine-node --captureExceptions  ./spec'.
npm ERR! This is most likely a problem with the ionic-app-lib package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR!     jasmine-node --captureExceptions  ./spec
npm ERR! You can get their info via:
npm ERR!     npm owner ls ionic-app-lib
npm ERR! There is likely additional logging output above.

npm ERR! Please include the following file with any support request:
npm ERR!     C:\server\www\ionic-app-lib\npm-debug.log

and the npm-log

0 info it worked if it ends with ok
1 verbose cli [ 'C:\\Program Files\\nodejs\\\\node.exe',
1 verbose cli   'C:\\Program Files\\nodejs\\node_modules\\npm\\bin\\npm-cli.js',
1 verbose cli   'run',
1 verbose cli   'jasmine' ]
2 info using [email protected]
3 info using [email protected]
4 verbose run-script [ 'prejasmine', 'jasmine', 'postjasmine' ]
5 info prejasmine [email protected]
6 info jasmine [email protected]
7 verbose unsafe-perm in lifecycle true
8 info [email protected] Failed to exec jasmine script
9 verbose stack Error: [email protected] jasmine: `jasmine-node --captureExceptions  ./spec`
9 verbose stack Exit status 1
9 verbose stack     at EventEmitter.<anonymous> (C:\Program Files\nodejs\node_modules\npm\lib\utils\lifecycle.js:213:16)
9 verbose stack     at EventEmitter.emit (events.js:110:17)
9 verbose stack     at ChildProcess.<anonymous> (C:\Program Files\nodejs\node_modules\npm\lib\utils\spawn.js:24:14)
9 verbose stack     at ChildProcess.emit (events.js:110:17)
9 verbose stack     at maybeClose (child_process.js:1015:16)
9 verbose stack     at Process.ChildProcess._handle.onexit (child_process.js:1087:5)
10 verbose pkgid [email protected]
11 verbose cwd C:\server\www\ionic-app-lib
12 error Windows_NT 6.3.9600
13 error argv "C:\\Program Files\\nodejs\\\\node.exe" "C:\\Program Files\\nodejs\\node_modules\\npm\\bin\\npm-cli.js" "run" "jasmine"
14 error node v0.12.4
15 error npm  v2.10.1
16 error code ELIFECYCLE
17 error [email protected] jasmine: `jasmine-node --captureExceptions  ./spec`
17 error Exit status 1
18 error Failed at the [email protected] jasmine script 'jasmine-node --captureExceptions  ./spec'.
18 error This is most likely a problem with the ionic-app-lib package,
18 error not with npm itself.
18 error Tell the author that this fails on your system:
18 error     jasmine-node --captureExceptions  ./spec
18 error You can get their info via:
18 error     npm owner ls ionic-app-lib
18 error There is likely additional logging output above.
19 verbose exit [ 1, true ]

So my question is, how we are supposed to run the tests? Do we need to be inside some ionic project or those tests should be able to run alone independently? Is there something else I can do to be able to run tests on Windows?

@leahciMic
Copy link
Contributor

@talamaska The tests pass for me on mac and linux, are you able to use one of those? Or retry the tests, and for things like wrong slash, change the test to use path.join, or path.normalize.

@jbavari
Copy link
Contributor

jbavari commented Nov 11, 2015

Yep, looks like I made a path mistake. Do you need help adjusting it? Fixing that path, may get it working again.

If you need help, holler at me.

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

No branches or pull requests

3 participants