From fa24b40701a83eaf73d584e931c58c34e4a7b34e Mon Sep 17 00:00:00 2001 From: Julian Simioni Date: Thu, 13 Sep 2018 17:27:13 -0400 Subject: [PATCH] chore(test): Use dedicated test script to catch errors 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 https://github.com/pelias/pelias/issues/744 --- bin/test | 7 +++++++ package.json | 2 +- 2 files changed, 8 insertions(+), 1 deletion(-) create mode 100755 bin/test diff --git a/bin/test b/bin/test new file mode 100755 index 0000000..9fd8569 --- /dev/null +++ b/bin/test @@ -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 diff --git a/package.json b/package.json index 2ba55a2..5defc17 100644 --- a/package.json +++ b/package.json @@ -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"