source: trip-planner-front/node_modules/karma-jasmine-html-reporter/README.md@ eed0bf8

Last change on this file since eed0bf8 was 6a3a178, checked in by Ema <ema_spirova@…>, 3 years ago

initial commit

  • Property mode set to 100644
File size: 2.3 KB
Line 
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
5Reporter that dynamically shows tests results at debug.html page.
6
7Jasmine 1.3 is not supported. For Jasmine < 3.0.0, use version 0.2.2
8
9![alt tag](/screenshots/reporter_1.png)
10
11You can also run a describe block, or a single test.
12
13![alt tag](/screenshots/reporter_2.png)
14
15## Installation
16
17You can simply install `karma-jasmine-html-reporter` as a devDependency by:
18```bash
19npm install karma-jasmine-html-reporter --save-dev
20```
21
22## Configuration
23```js
24// karma.conf.js
25module.exports = function(config) {
26 config.set({
27 reporters: ['kjhtml']
28 });
29};
30```
31#### With options
32In combination with multiple reporters you may want to disable terminal messages because it's already handled by another reporter.
33
34*Example using the 'karma-mocha-reporter' plugin*:
35```js
36// karma.conf.js
37module.exports = function(config) {
38 config.set({
39
40 // Combine multiple reporters
41 reporters: ['kjhtml', 'mocha'],
42
43 jasmineHtmlReporter: {
44 suppressAll: true, // Suppress all messages (overrides other suppress settings)
45 suppressFailed: true // Suppress failed messages
46 }
47
48 });
49};
50```
51
52You can pass a list of reporters as a CLI argument too:
53```bash
54karma start --reporters kjhtml
55```
56
57## Develop
58
59There's not much to this package.
60
61[`adapter.js`](src/lib/adapter.js), [`html.jasmine.reporter.js`](src/lib/html.jasmine.reporter.js), and [`jasmine.css`](src/css/jasmine.css) are copied with small adjustments from [`jasmine/lib/jasmine-core/boot.js`](https://github.com/jasmine/jasmine/blob/main/lib/jasmine-core/boot.js) and [`jasmine/lib/jasmine-core/jasmine-html.js`](https://github.com/jasmine/jasmine/blob/main/lib/jasmine-core/jasmine-html.js), and [`jasmine/lib/jasmine-core/jasmine.css`](https://github.com/jasmine/jasmine/blob/main/lib/jasmine-core/jasmine.css) respectively.
62
63Just pull over changes from Jasmine as needed. There is a script to help with that; just run `npm run build` and review the changes. Specifically, [`adapter.js`](src/lib/adapter.js) needs a lot of manual removals.
Note: See TracBrowser for help on using the repository browser.