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.

punkrockbuddyholly
  • 9,675
  • 7
  • 36
  • 69
  • i run into the same issue... (win10) `jasmine spec/jasmine_examples/PlayerSpec.js`doesn't work either – Harry Sep 06 '16 at 18:49
  • DId you get any solution for this? I have the same problem – Stefano Borini Sep 06 '16 at 21:52
  • 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. – punkrockbuddyholly Sep 06 '16 at 22:30
  • 1
    @MrMisterMan ok, then I opened an issue on jasmine, because it's unacceptable that doing exactly what the documentation says produces no feedback whatsoever. – Stefano Borini Sep 06 '16 at 22:31

2 Answers2

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
}
Bamieh
  • 10,358
  • 4
  • 31
  • 52
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
Stefano Borini
  • 138,652
  • 96
  • 297
  • 431