Skip to content

Commit

Permalink
refactor(*): use mocha config file, refactor seriesci script
Browse files Browse the repository at this point in the history
  • Loading branch information
kopach committed Jun 24, 2020
1 parent eb548cf commit 85c450c
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 5 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@
"snyk-protect": "snyk protect",
"tdd": "concurrently --kill-others \"npm run test:watch\" \"live-server --watch=coverage/lcov-report --open=coverage/lcov-report --quiet\"",
"pretest": "npm run generate-public-api-schema",
"test": "nyc mocha --config test/.mocharc.json --exit --require ts-node/register **/*.ts",
"test": "nyc mocha --config test/.mocharc.json **/*.ts",
"test:ci": "npm run test",
"posttest:ci": "codecov",
"test:watch": "onchange --kill --initial 'test/*.spec.ts' 'src/*.ts' -- npm run test"
Expand Down
6 changes: 3 additions & 3 deletions scripts/npm_run_time.sh
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,10 @@ cmd="npm run ${script_name}"
$cmd
cmdExitCode=$(echo $? | bc -l)

if [ $cmdExitCode -ne 0 ]; then
exit ${cmdExitCode}
if [ "${cmdExitCode}" -ne 0 ]; then
exit "${cmdExitCode}"
else
duration=$(echo "$(date +%s) - $startTime" | bc)
echo "${script_name} time: ${duration}s"
echo "${duration}s" > ${script_name}-execution-time.log
echo "${duration}s" > "${script_name}-execution-time.log"
fi
4 changes: 3 additions & 1 deletion test/.mocharc.json
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
{
"timeout": 60000
"timeout": 60000,
"exit": true,
"require": "ts-node/register"
}

0 comments on commit 85c450c

Please sign in to comment.