File tree Expand file tree Collapse file tree 3 files changed +16
-3
lines changed Expand file tree Collapse file tree 3 files changed +16
-3
lines changed Original file line number Diff line number Diff line change @@ -16,12 +16,25 @@ $ npm install
16
16
$ npm run build
17
17
```
18
18
19
- ## Run the test
19
+ ## Running the tests
20
20
21
+ On one terminal window/tab, start the Karma server:
22
+
23
+ ```
24
+ $ npx cross-env BABEL_ENV=test karma start --no-watch --no-progress
25
+ ```
26
+
27
+ Then on your main terminal, to run the test, type:
21
28
```
22
29
$ npm run test
23
30
```
24
31
32
+ If you don't want to start a server, you can do a single run of karma. Not advised though as it's a bit fragile
33
+
34
+ ```
35
+ $ npx cross-env BABEL_ENV=test karma start -no-watch --no-progress --single-run
36
+ ```
37
+
25
38
## Background
26
39
27
40
This is a follow up to my single web page CodePen example for testing a VueJS app using Jasmine:
Original file line number Diff line number Diff line change @@ -40,7 +40,7 @@ module.exports = function(config) {
40
40
// start these browsers
41
41
// available browser launchers: https://npmjs.org/browse/keyword/karma-launcher
42
42
browsers : [
43
- 'Chrome ' , 'Firefox '
43
+ 'ChromeHeadless ' , 'FirefoxHeadless '
44
44
] ,
45
45
} )
46
46
}
Original file line number Diff line number Diff line change 31
31
"webpack-cli" : " ^3.3.10"
32
32
},
33
33
"scripts" : {
34
- "test" : " cross-env BABEL_ENV=test karma start --no-watch --no-progress " ,
34
+ "test" : " cross-env BABEL_ENV=test karma run " ,
35
35
"build" : " webpack"
36
36
},
37
37
"author" : " Rija Menage" ,
You can’t perform that action at this time.
0 commit comments