Skip to content

Commit 61848a8

Browse files
author
Rija Menage
committed
Update README with instructions, use headless version of browsers
1 parent c8a1369 commit 61848a8

File tree

3 files changed

+16
-3
lines changed

3 files changed

+16
-3
lines changed

README.md

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,12 +16,25 @@ $ npm install
1616
$ npm run build
1717
```
1818

19-
## Run the test
19+
## Running the tests
2020

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:
2128
```
2229
$ npm run test
2330
```
2431

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+
2538
## Background
2639

2740
This is a follow up to my single web page CodePen example for testing a VueJS app using Jasmine:

karma.conf.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ module.exports = function(config) {
4040
// start these browsers
4141
// available browser launchers: https://npmjs.org/browse/keyword/karma-launcher
4242
browsers: [
43-
'Chrome','Firefox'
43+
'ChromeHeadless','FirefoxHeadless'
4444
],
4545
})
4646
}

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@
3131
"webpack-cli": "^3.3.10"
3232
},
3333
"scripts": {
34-
"test": "cross-env BABEL_ENV=test karma start --no-watch --no-progress",
34+
"test": "cross-env BABEL_ENV=test karma run",
3535
"build": "webpack"
3636
},
3737
"author": "Rija Menage",

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy