Skip to content

Commit 51e0986

Browse files
jmatsushitaowickstrom
authored andcommitted
Usage with Spago and Parcel
1 parent cc1e033 commit 51e0986

File tree

1 file changed

+16
-0
lines changed

1 file changed

+16
-0
lines changed

Diff for: README.md

+16
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,22 @@ require('test.xhr.js');
6868
main(); // Purescript specs load when the function is called.
6969
```
7070

71+
### Usage with Spago and Parcel
72+
73+
With `spago` and `parcel-bundler`, and the above `test/index.html` you can build tests, and run them on node and browsers with the following entries in your `package.json`
74+
```json
75+
...
76+
"scripts": {
77+
"test:build": "spago bundle-app --main Test.Main --to ./output/test.js",
78+
"test:watch": "spago bundle-app --watch --main Test.Main --to ./output/test.js --then \"npm run -s test:node\"",
79+
"test:node": "mocha ./output/test.js",
80+
"test:browser": "parcel test/index.html --open"
81+
},
82+
...
83+
```
84+
85+
Running `npm run test:watch` in one terminal window and `npm run test:browser` in another will watch purescript source and tests files and automatically run node and browser tests.
86+
7187
## API Documentation
7288

7389
See [docs on Pursuit](https://pursuit.purescript.org/packages/purescript-spec-mocha).

0 commit comments

Comments
 (0)