Skip to content

Commit

Permalink
chore(test): Use dedicated test script to catch errors
Browse files Browse the repository at this point in the history
The way we were running our unit tests does not catch fatal errors in
the unit test run, even though they return non-zero status codes.

By using a dedicated script to run the tests, with the `pipefail`
option, we can catch them.

Connects pelias/pelias#744
  • Loading branch information
orangejulius committed Sep 13, 2018
1 parent 750f255 commit fa24b40
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
7 changes: 7 additions & 0 deletions bin/test
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
#!/bin/bash

# run tests with pipefail to avoid false passes
# see https://github.com/pelias/pelias/issues/744
set -euo pipefail

node test/test | npx tap-dot
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
"description": "Module that provides a convenience wrapper around HTTP GET microservices",
"main": "index.js",
"scripts": {
"test": "node test/test | tap-dot",
"test": "./bin/test",
"lint": "jshint .",
"travis": "npm test",
"validate": "npm ls"
Expand Down

0 comments on commit fa24b40

Please sign in to comment.