/
build-and-test.ps1
42 lines (38 loc) · 1012 Bytes
/
build-and-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
38
39
40
41
42
npm ci
npm run dist
npm run build:v3
Copy-Item "package.json" -Destination "dist"
Copy-Item "package-lock.json" -Destination "dist"
Copy-Item -Path "native" -Destination "dist" -Recurse
pushd dist
npm link
popd
Get-ChildItem ".\examples" -Directory | ForEach-Object {
if ($_.Name -ne "v3") {
Write-Output "Running examples in $($_.Name)"
pushd $_.FullName
npm link @pact-foundation/pact
npm i
npm t
if ($LastExitCode -ne 0) {
Write-Output "Non-zero exit code!"
$host.SetShouldExit($LastExitCode)
}
popd
}
}
Write-Output "Done with E2E tests"
Get-ChildItem ".\examples\v3" -Directory | ForEach-Object {
Write-Output "Running V3 examples in $($_.Name)"
pushd $_.FullName
npm i
Remove-Item -LiteralPath "node_modules\@pact-foundation\pact" -Force -Recurse
npm link @pact-foundation/pact
npm t
if ($LastExitCode -ne 0) {
Write-Output "Non-zero exit code!"
$host.SetShouldExit($LastExitCode)
}
popd
}
Write-Output "Done with V3 E2E tests"