Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to suppress output for skipped tests in Jasmine

If I have the scenario with 1000+ tests and want to run only selected portion of them I can use fdescribe.

The rest of tests are skipped which is great however they still pollute the console output. How can I suppress the console output for skipped tests?

like image 384
webduvet Avatar asked Aug 22 '15 09:08

webduvet


1 Answers

If you're running tests via Karma, there is a spec reporter plugin that you can configure to ignore various things.

https://www.npmjs.com/package/karma-spec-reporter

https://www.npmjs.com/package/karma-spec-reporter-2

Add the following to your karma.conf.js:

...
  config.set({
    ...
      reporters: ["spec"],
      specReporter: {
        suppressSkipped: true, // do not print information about skipped tests 
      },
      plugins: ["karma-spec-reporter"],
    ...

If you're not using Karma, then you need to find the proper Jasmine reporter and configure it, or create your own reporter.

https://www.npmjs.com/package/jasmine2-reporter

like image 64
Snekse Avatar answered Oct 11 '22 13:10

Snekse