suppress error logging by providing NODE_ENV=test, relates to #78

This commit is contained in:
Konstantin Pogorelov
2021-02-19 12:42:27 +01:00
parent bef92b77e1
commit 62abb62772
3 changed files with 4 additions and 4 deletions

View File

@@ -1,7 +1,7 @@
.PHONY: coverage
test:
./node_modules/jasme/run.js
npm test
lint:
node_modules/eslint/bin/eslint.js src
node_modules/.bin/dtslint types

View File

@@ -16,7 +16,7 @@
],
"types": "types",
"scripts": {
"test": "node_modules/jasme/run.js",
"test": "NODE_ENV=test node_modules/jasme/run.js",
"lint": "eslint src",
"coverage": "make coverage",
"dtslint": "dtslint types",

View File

@@ -414,8 +414,6 @@ describe('index', () => {
const instance = bundle({});
app.use(instance);
spyOn(console, 'error'); // mute console.error
new promClient.Gauge({
name: 'kaboom',
help: 'this metric explodes',
@@ -424,6 +422,8 @@ describe('index', () => {
}
});
// the error will NOT be displayed if NODE_ENV=test (as defined in package.json)
supertest(app)
.get('/metrics')
.expect(500)