Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

how do I log the specs when the tests are successful in Jasmine?

As, mocha logs the specs string if the test is successful. for the below test suite,

describe("capitalize", function() {
   it("capitalizes single words", function() { /* … */});
   it("makes the rest of the string lowercase", function() {
     expect(capitalize("javaScript")).to.equal("Javascript");
   });
});

firing the npm test command would log the following,

capitalize
✓ capitalizes single words
✓ makes the rest of the string lowercase
2 passing (10ms)

The same when written with jasmine would simply log two green dots denoting that the tests were successful. So, is there any way to achieve the mocha like logs ? As the official docs do not help in this regard !

like image 330
Vickar Avatar asked Oct 17 '25 02:10

Vickar


1 Answers

You can use jasmine-spec-reporter, it is a jasmine reporter that display output this way:

Spec started

  first suite
    ✓ should be ok
    ✗ should failed
      - Expected true to be false.
like image 154
Bastien Caudan Avatar answered Oct 19 '25 17:10

Bastien Caudan



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!