Skip to content

Commit 86ce7e1

Browse files
committed
Only run with eval disabled on Node 12+
- NODE_OPTIONS=--disallow-code-generation-from-strings is not available until Node 12 - split travis scripts to ensure failure of either stage will fail the build
1 parent 11977ad commit 86ce7e1

File tree

2 files changed

+7
-5
lines changed

2 files changed

+7
-5
lines changed

.travis.yml

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -86,11 +86,13 @@ before_install:
8686
npm rebuild
8787
fi
8888
script:
89-
# Run test script
89+
# Run test script with eval disabled (requires Node 12+ for NODE_OPTIONS=--disallow-code-generation-from-strings)
9090
- |
91-
if [[ "$(cut -d. -f1 <<< "$TRAVIS_NODE_VERSION")" -gt 8 ]]; then
91+
if [[ "$(cut -d. -f1 <<< "$TRAVIS_NODE_VERSION")" -gt 11 ]]; then
9292
npm run test-noeval
9393
fi
94+
# Run test script with eval enabled (including code coverage if available)
95+
- |
9496
if npm -ps ls nyc | grep -q nyc; then
9597
npm run test-ci
9698
else

appveyor.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -76,11 +76,11 @@ test_script:
7676
- ps: |
7777
node --version
7878
npm --version
79-
# Run test script with eval disabled, if supported (node >= 9)
79+
# Run test script with eval disabled, if supported (node 12+)
8080
- ps: |
81-
if ([int]$env:nodejs_version.split(".")[0] -gt 8) {
81+
if ([int]$env:nodejs_version.split(".")[0] -gt 11) {
8282
npm run test-noeval
8383
}
84-
# Run test script
84+
# Run test script with eval enabled
8585
- npm run test-eval
8686
version: "{build}"

0 commit comments

Comments
 (0)