Skip to content

Commit ba07650

Browse files
committed
Updated test scripts to be more consistent
1 parent 6330d1b commit ba07650

File tree

2 files changed

+12
-13
lines changed

2 files changed

+12
-13
lines changed

runTests.ps1

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -4,14 +4,16 @@ $ErrorFound = $False
44

55
try
66
{
7-
If ($args.Length -eq 0)
7+
If ($args.Length -gt 0)
88
{
9-
npm run start-neo4j
9+
$env:NEOCTRL_ARGS="$args"
1010
}
11-
else
11+
12+
npm run start-neo4j
13+
if($LastExitCode -ne 0) #failed to execute npm test without error
1214
{
13-
$env:NEOCTRL_ARGS="$args"
14-
npm run start-neo4j
15+
Write-Host "Unable to start neo4j"
16+
exit 1
1517
}
1618

1719
npm test
@@ -23,7 +25,7 @@ try
2325
finally
2426
{
2527
npm run stop-neo4j
26-
if($ErrorFound -eq $True)
28+
if($ErrorFound)
2729
{
2830
Write-Host "Exit with code 1"
2931
exit 1

runTests.sh

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -5,14 +5,11 @@ function finish {
55
}
66
trap finish EXIT
77

8+
89
npm install
910

10-
if [ "$1" == "" ]; then
11-
npm run start-neo4j
12-
else
13-
# Example: ./runTests.sh '-e 3.1.3'
14-
NEOCTRL_ARGS="$1" npm run start-neo4j
11+
if [[ ! -z "$1" ]]; then
12+
export NEOCTRL_ARGS="$1"
1513
fi
1614

17-
sleep 2
18-
npm test
15+
npm run start-neo4j && npm test

0 commit comments

Comments
 (0)