-
Notifications
You must be signed in to change notification settings - Fork 48
/
test.ps1
37 lines (29 loc) · 870 Bytes
/
test.ps1
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
# Generate the TestSuite
haxelib run munit gen
# Compile the haxe code
haxe ./tests/test.hxml
#If compile was unsuccessful exit here
if (-not ($?)) {
$host.UI.RawUI.ForegroundColor = "Red"
write-host "Haxe compilation unsuccessful. Press any key to continue..."
[void][System.Console]::ReadKey($true)
exit
}
#Start a web browser on the proper web address
Start-Process "http://localhost:3000"
#Move into node folder
Push-Location ./tests/unittest_node/
#If node modules are not present, install them
if (-not (Test-Path "node_modules")) {
npm install
}
#Exit out of node folder
Pop-Location
#Start node
npm start --prefix tests/unittest_node
#If node crashed give a warning
if (-not ($?)) {
$host.UI.RawUI.ForegroundColor = "Red"
write-host "Server was not started, is the port busy? Press any key to continue..."
[void][System.Console]::ReadKey($true)
}