Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 0ff387d

Browse files
committed
update CONTRIBUTING for new test-jasmine API
1 parent e574951 commit 0ff387d

File tree

1 file changed

+33
-4
lines changed

1 file changed

+33
-4
lines changed

CONTRIBUTING.md

Lines changed: 33 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -104,6 +104,8 @@ Both jasmine and image tests are run on
104104
[CircleCI](https://circleci.com/gh/plotly/plotly.js) on every push to this
105105
repo.
106106

107+
### Jasmine tests
108+
107109
Jasmine tests are run in a browser using
108110
[karma](https://github.com/karma-runner/karma). To run them locally:
109111

@@ -114,17 +116,44 @@ npm run test-jasmine
114116
To run a specific suite, use:
115117

116118
```
117-
npm run test-jasmine -- tests/<suite>.js
119+
npm run test-jasmine -- <suite>
120+
```
121+
122+
where the `<suite>` corresponds to the suite's file name as found in
123+
[`test/jasmine/tests/`](https://github.com/plotly/plotly.js/tree/master/test/jasmine/tests).
124+
125+
You can also test multiple suites at a time, for example:
126+
127+
```
128+
npm run test-jasmine -- bar axes scatter
129+
```
130+
131+
which will run tests in the `bar_test.js`, `axes_test.js` and `scatter_test.js`
132+
suites.
133+
134+
To run the tests in an `autoWatch` / auto-bundle / multiple run mode:
135+
136+
```
137+
npm run test-jasmine -- <suite> --watch
118138
```
119139

120-
where the `<suite>` corresponds to the suite's file name as found in [`test/jasmine/tests/`](https://github.com/plotly/plotly.js/tree/master/test/jasmine/tests). In certain situations, you may find that the default reporting is not verbose enough to pin down the source of the failing test. In this situation, you may wish to use [karma-verbose-reporter](https://www.npmjs.com/package/karma-verbose-reporter). You can use it without adding as a dev dependency by running:
140+
In certain situations, you may find that the default reporting is not verbose
141+
enough to pin down the source of the failing test. In this situation, you may
142+
wish to use
143+
[karma-verbose-reporter](https://www.npmjs.com/package/karma-verbose-reporter):
121144

122145
```
123-
npm install karma-verbose-reporter
146+
npm run test-jasmine -- <suite> --verbose
124147
```
125148

126-
and adding `reporters: ['verbose']` to the corresponding karma configuration file. (You should disable the `progress` reporter when using `verbose`.)
149+
For more info on the karma / jasmine CLI:
150+
151+
```
152+
npm run test-jasmine -- --help
153+
npm run test-jasmine -- --info
154+
```
127155

156+
### Image pixel comparison tests
128157

129158
Image pixel comparison tests are run in a docker container. For more
130159
information on how to run them locally, please refer to [image test

0 commit comments

Comments
 (0)