From c67825392c30f0d1bca0fe28af74fd27ba4a943e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Robert=20Sch=C3=A4fer?= Date: Fri, 12 Apr 2019 20:43:03 +0200 Subject: [PATCH] Silence expected error messages on build server @ulfgebhardt we have a quite lengthy log output on our build server. This `2> /dev/null` prevents the server from writing log output for expected errors. E.g. we're testing if a user can log in with incorrect credentials or we try to create duplicates for unique slugs. All of this will output errors to the command line which we're not interested in. We could think of configuring the `package.json` in a way that outputs these error messages in case we set an environment variable: ``` DEBUG=1 yarn run test:jest ``` That would be an option. Or use the `debug` npm packages that @Mastercuber has introduced. --- backend/package.json | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/backend/package.json b/backend/package.json index a3f03f1fb..beb46da10 100644 --- a/backend/package.json +++ b/backend/package.json @@ -10,8 +10,8 @@ "dev:debug": "nodemon --exec babel-node --inspect=0.0.0.0:9229 src/index.js -e js,graphql", "lint": "eslint src --config .eslintrc.js", "test": "run-s test:jest test:cucumber", - "test:before:server": "cross-env GRAPHQL_URI=http://localhost:4123 GRAPHQL_PORT=4123 yarn run dev", - "test:before:seeder": "cross-env GRAPHQL_URI=http://localhost:4001 GRAPHQL_PORT=4001 DISABLED_MIDDLEWARES=permissions,activityPub yarn run dev", + "test:before:server": "cross-env GRAPHQL_URI=http://localhost:4123 GRAPHQL_PORT=4123 yarn run dev 2> /dev/null", + "test:before:seeder": "cross-env GRAPHQL_URI=http://localhost:4001 GRAPHQL_PORT=4001 DISABLED_MIDDLEWARES=permissions,activityPub yarn run dev 2> /dev/null", "test:jest:cmd": "wait-on tcp:4001 tcp:4123 && jest --forceExit --detectOpenHandles --runInBand", "test:cucumber:cmd": "wait-on tcp:4001 tcp:4123 && cucumber-js --require-module @babel/register --exit test/", "test:jest:cmd:debug": "wait-on tcp:4001 tcp:4123 && node --inspect-brk ./node_modules/.bin/jest -i --forceExit --detectOpenHandles --runInBand", @@ -94,4 +94,4 @@ "nodemon": "~1.18.11", "supertest": "~4.0.2" } -} \ No newline at end of file +}