-
Notifications
You must be signed in to change notification settings - Fork 207
/
appveyor.yml
59 lines (59 loc) · 2.02 KB
/
appveyor.yml
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
48
49
50
51
52
53
54
55
56
57
58
59
environment:
matrix:
- nodejs_version: "0.10"
- nodejs_version: "4.9"
- nodejs_version: "6.17"
- nodejs_version: "8.17"
- nodejs_version: "10.24"
- nodejs_version: "12.22"
- nodejs_version: "14.18"
- nodejs_version: "16.13"
install:
# Install Node.js
- ps: >-
try { Install-Product node $env:nodejs_version -ErrorAction Stop }
catch { Update-NodeJsInstallation (Get-NodeJsLatestBuild $env:nodejs_version) }
# Setup npm
- for /f "tokens=*" %%g in ('where npm') do (set npm_prefix=%%~dpg)
- npm config set shrinkwrap false
# Remove all non-test dependencies
- npm rm --silent --save-dev eslint eslint-plugin-markdown nyc
# Setup Node.js version-specific dependencies
- ps: |
# mocha for testing
# - use 3.x for Node.js < 4
# - use 5.x for Node.js < 6
# - use 6.x for Node.js < 8
# - use 7.x for Node.js < 10
# - use 8.x for Node.js < 12
if ([int]$env:nodejs_version.split(".")[0] -lt 4) {
npm install --silent --save-dev [email protected]
} elseif ([int]$env:nodejs_version.split(".")[0] -lt 6) {
npm install --silent --save-dev [email protected]
} elseif ([int]$env:nodejs_version.split(".")[0] -lt 8) {
npm install --silent --save-dev [email protected]
} elseif ([int]$env:nodejs_version.split(".")[0] -lt 10) {
npm install --silent --save-dev [email protected]
} elseif ([int]$env:nodejs_version.split(".")[0] -lt 12) {
npm install --silent --save-dev [email protected]
}
- ps: |
# supertest for http calls
# - use 2.0.0 for Node.js < 4
# - use 3.4.2 for Node.js < 6
if ([int]$env:nodejs_version.split(".")[0] -lt 4) {
npm install --silent --save-dev [email protected]
} elseif ([int]$env:nodejs_version.split(".")[0] -lt 6) {
npm install --silent --save-dev [email protected]
}
# Install Node.js modules
- npm install
build: off
test_script:
# Output version data
- ps: |
node --version
npm --version
# Run test script
- npm test
version: "{build}"