1 | # karma-jasmine-html-reporter
|
2 |
|
3 | [![npm version](https://img.shields.io/npm/v/karma-jasmine-html-reporter.svg)](https://www.npmjs.com/package/karma-jasmine-html-reporter) [![npm downloads](https://img.shields.io/npm/dm/karma-jasmine-html-reporter.svg)](https://www.npmjs.com/package/karma-jasmine-html-reporter)
|
4 |
|
5 | Reporter that dynamically shows tests results at debug.html page.
|
6 |
|
7 | ![alt tag](/screenshots/reporter_1.png)
|
8 |
|
9 | You can also run a describe block, or a single test.
|
10 |
|
11 | ![alt tag](/screenshots/reporter_2.png)
|
12 |
|
13 | ## Installation
|
14 |
|
15 | You can simply install `karma-jasmine-html-reporter` as a devDependency by:
|
16 | ```bash
|
17 | npm install karma-jasmine-html-reporter --save-dev
|
18 | ```
|
19 |
|
20 | ## Configuration
|
21 | ```js
|
22 | // karma.conf.js
|
23 | module.exports = function(config) {
|
24 | config.set({
|
25 | frameworks: ['jasmine'],
|
26 | plugins: [
|
27 | require('karma-jasmine'),
|
28 | require('karma-jasmine-html-reporter')
|
29 | ],
|
30 | client: {
|
31 | jasmine: {
|
32 | // you can add configuration options for Jasmine here
|
33 | // the possible options are listed at https://jasmine.github.io/api/edge/Configuration.html
|
34 | // for example, you can disable the random execution with `random: false`
|
35 | // or set a specific seed with `seed: 4321`
|
36 | }
|
37 | },
|
38 | reporters: ['kjhtml']
|
39 | });
|
40 | };
|
41 | ```
|
42 | #### With options
|
43 | In combination with multiple reporters you may want to disable terminal messages because it's already handled by another reporter.
|
44 |
|
45 | *Example using the 'karma-mocha-reporter' plugin*:
|
46 | ```js
|
47 | // karma.conf.js
|
48 | module.exports = function(config) {
|
49 | config.set({
|
50 |
|
51 | // Combine multiple reporters
|
52 | reporters: ['kjhtml', 'mocha'],
|
53 |
|
54 | jasmineHtmlReporter: {
|
55 | suppressAll: true, // Suppress all messages (overrides other suppress settings)
|
56 | suppressFailed: true // Suppress failed messages
|
57 | }
|
58 |
|
59 | });
|
60 | };
|
61 | ```
|
62 |
|
63 | You can pass a list of reporters as a CLI argument too:
|
64 | ```bash
|
65 | karma start --reporters kjhtml
|
66 | ```
|
67 |
|
68 | ## Version compatibility
|
69 |
|
70 | jasmine Version | karma-jasmine-html-reporter version
|
71 | -|-
|
72 | 2.x | 0.2.2
|
73 | 3.x | 1.x
|
74 | 4.x | 2.x
|