Skip to content

Commit

Permalink
Test on modern node runtimes
Browse files Browse the repository at this point in the history
1. Increase timeout when run tests with coverage report to resolve following issues.

   https://travis-ci.org/Gasol/aglio/jobs/531855660

      1) Executable
           Should start a live preview server:
         Error: Timeout of 5000ms exceeded. For async tests and hooks, ensure "done()" is called; if returning a Promise, ensure it resolves. (/home/travis/build/Gasol/aglio/test/basic.coffee)
          at Timeout._onTimeout (test/basic.coffee:306:37)
          at listOnTimeout (internal/timers.js:531:17)
          at processTimers (internal/timers.js:475:7)

2. Keep the npm cache

   https://docs.travis-ci.com/user/caching/#npm-cache
  • Loading branch information
Gasol committed May 15, 2019
1 parent 4c20e22 commit 333da52
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 11 deletions.
23 changes: 14 additions & 9 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,19 +1,24 @@
dist: xenial
language: node_js
sudo: false
node_js:
- "0.10"
- "0.12"
- "3"
- "4"
- "5"
- "6"
- "6"
- "8"
- "10"
- "11"
- "12"

addons:
apt:
sources:
- ubuntu-toolchain-r-test
packages:
- gcc-4.8
- g++-4.8
env: CXX="g++-4.8" CC="gcc-4.8"

env:
- CXX="g++-4.8" CC="gcc-4.8"

after_script:
- npm run coveralls
- if [ "$TRAVIS_NODE_VERSION" = "12" ]; then npm run coveralls; fi

cache: npm
5 changes: 4 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,14 @@
"bin": {
"aglio": "./bin/aglio.js"
},
"config": {
"coverage_timeout": 10000
},
"scripts": {
"build": "npm run lint && npm run compile",
"compile": "coffee -o lib -c src",
"coverage": "npm run coverage:html",
"coverage:text": "npm run build && c8 mocha",
"coverage:text": "npm run build && c8 mocha -t $npm_package_config_coverage_timeout",
"coverage:html": "npm run coverage:text && c8 -r html report",
"coveralls": "npm run coverage:text && c8 -r text-lcov report | coveralls",
"gen:examples": "npm run compile && ./scripts/generate-examples",
Expand Down
2 changes: 1 addition & 1 deletion test/basic.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -271,7 +271,7 @@ describe 'Executable', ->
done()

it 'Should start a live preview server', (done) ->
@timeout 5000
@timeout process.env.npm_package_config_coverage_timeout || 5000

sinon
.stub aglio, 'render'
Expand Down

0 comments on commit 333da52

Please sign in to comment.