Newer
Older
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
#! /bin/bash
echo 'Running all tests ...'
echo 'Running linter ...'
# check lint
npm run lint &> check_all_lint.log || exit
echo 'Linter complete.'
echo 'Running unit tests ...'
# unit test
NODE_ENV=test npm run test &> check_all_test.log || exit
echo 'Unit tests complete.'
echo 'Running server tests ...'
cd deploy
npm run test &> check_all_deploy_test.log || exit
echo 'Server test complete.'
cd ..
echo 'Building and running e2e tests ...'
echo 'Building ...'
# e2e tests
npm run build-aot &> check_all_build_aot.log || exit
echo 'Build complete.'
echo 'Spinning up node server ...'
# run node server
cd deploy
node server.js &> check_all_deploy_server.log &
NDOE_SERVER_PID=$!
# run e2e test
echo 'Running e2e tests ...'
cd ..
npm run e2e &> check_all_e2e.log || kill "$NDOE_SERVER_PID" && exit
echo 'e2e tests complete.'
echo 'Killing server.js pid $NDOE_SERVER_PID'
kill "$NDOE_SERVER_PID"
echo 'All runs complete.'