Why does running `jasmine` after `jasmine init` and `jasmine examples` do nothing?
Asked Answered
W

2

10

I have globally installed jasmine by running npm install jasmine -g.

Running jasmine -v gives me

jasmine v2.5.0
jasmine-core v2.5.0

I have then, as per the docs, run

jasmine init
jasmine examples

This created the expected /spec directory and the spec/support/jasmine.json file.

I am under the impression that if I now run jasmine I should see some test output in the console. Instead it simply thinks about it for a second and then does nothing.

I'm running node v4.5.0 on a Windows 7 machine in a Git Bash terminal. I've tried running it from the Windows cmd prompt as well but that doesn't work either.

Wingback answered 1/9, 2016 at 13:21 Comment(4)
i run into the same issue... (win10) jasmine spec/jasmine_examples/PlayerSpec.jsdoesn't work eitherStriction
DId you get any solution for this? I have the same problemKultur
Unfortunately not. I have finally got jasmine working via webpack and karma but I am still unable to run these example tests in the way described in the docs.Wingback
@MrMisterMan ok, then I opened an issue on jasmine, because it's unacceptable that doing exactly what the documentation says produces no feedback whatsoever.Kultur
E
3

well jasmine does run, but it doesn't report anything when you run jasmine alone. (you can confirm that by putting console.log inside describe functions and see that indeed it will log.)

download the latest release, it will have an html file that you can run which will do all the work for you.

https://github.com/jasmine/jasmine/releases

basically running jasmine requires a boot.js file for configurations. a jasmine-html.js file for the html reporter. you can figure out everything yourself by running the SpecRunner.html.

my personal preference is to use protractor and have the reporter configured in the protractor.config file.

if you want to run jasmine and have it run, you need to add your own boot.js and reporter, and loading them first thing before the spec in the jasmine.json file.

{
  "spec_dir": "spec",
  "spec_files": [
    "boot.js",
    "**/*[sS]pec.js"
  ],
  "helpers": [
    "helpers/**/*.js"
  ],
  "stopSpecOnExpectationFailure": false,
  "random": false
}
Extortionate answered 6/9, 2016 at 22:48 Comment(0)
K
2

It's a bug in jasmine

https://github.com/jasmine/jasmine-npm/issues/90

Use version 2.4

npm install -g jasmine@~2.4
Kultur answered 7/9, 2016 at 9:16 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.