Skip to content

Commit

Permalink
[dev] Add unified {build,test} watch mode, using "concurrently" (nati…
Browse files Browse the repository at this point in the history
…vefier#1011)

I noticed that the development README suggested using multiple console 
windows/tabs for a good development experience. Using the package `concurrently`,
we can streamline that and require only one window with output for both watch processes:

![image](https://user-images.githubusercontent.com/12286274/88694827-477d9e80-d0be-11ea-898c-ee9a509db4bb.png)


Co-authored-by: Ronan Jouchet <[email protected]>
  • Loading branch information
joeskeen and ronjouch authored Aug 5, 2020
1 parent 8e8cd24 commit 3e5f1fa
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 4 deletions.
8 changes: 5 additions & 3 deletions docs/development.md
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,8 @@ After doing so, you can run Nativefier with your test parameters:
nativefier --your-awesome-new-flag 'https://your-test-site.com'
```

Then run your nativefier app *through the command line too* (to see logs & errors):
Then run your nativefier app _through the command line too_ (to see logs & errors):

```bash
# Under Linux
./your-test-site-linux-x64/your-test-site
Expand All @@ -67,5 +68,6 @@ but is painful to do manually. Do yourself a favor and install a
- Logging is suppressed by default in tests, to avoid polluting Jest output.
To get debug logs, `npm run test:withlog` or set the `LOGLEVEL` env. var.
- For a good live experience, open two terminal panes/tabs running code/tests watchers:
1. Run a TSC watcher: `npm run build:watch`
2. Run a Jest unit tests watcher: `npm run test:watch`
1. Run a TSC watcher: `npm run build:watch`
2. Run a Jest unit tests watcher: `npm run test:watch`
- Alternatively, you can run both test processes in the same terminal by running: `npm run watch`
3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,8 @@
"test:unit": "jest",
"test:watch": "jest --watch",
"test:withlog": "LOGLEVEL=trace npm run test",
"test": "jest --testRegex '[-.]test\\.js$'"
"test": "jest --testRegex '[-.]test\\.js$'",
"watch": "npx concurrently \"npm:*:watch\""
},
"dependencies": {
"@types/cheerio": "0.x",
Expand Down

0 comments on commit 3e5f1fa

Please sign in to comment.