Skip to content

Commit

Permalink
[CS1] Travis CI for 1.x (#4797)
Browse files Browse the repository at this point in the history
* Update dependencies, use ~ notation for compatibility with Travis Node 0.8

* First attempt at .travis.yml for 1.x

* Drop Node 0.8 because dev dependencies want a higher Node runtime version; run all tests in harmony mode

* Closure Compiler requires Node 4+

* Exclude the test files that use template literal syntax for Node < 4, where that syntax is unsupported

* Filter out incompatible tests for Node 0.10
  • Loading branch information
GeoffreyBooth committed Nov 27, 2017
1 parent 1ad9c61 commit c5f4314
Show file tree
Hide file tree
Showing 4 changed files with 490 additions and 4 deletions.
21 changes: 21 additions & 0 deletions .travis.yml
@@ -0,0 +1,21 @@
language: node_js

node_js:
- 0.10
- 0.12
- 4
- 6
- 8
- node

cache:
directories:
- node_modules

script:
- node ./bin/cake build:except-parser
- node ./bin/cake build:parser
- node --harmony ./bin/cake build:full
- node ./bin/cake build:browser
- node --harmony ./bin/cake test
- node --harmony ./bin/cake test:browser
21 changes: 20 additions & 1 deletion Cakefile
Expand Up @@ -145,7 +145,8 @@ task 'build:browser', 'merge the built scripts into a single file for use in a b
}
}(this));
"""
unless process.env.MINIFY is 'false'
unless process.env.MINIFY is 'false' or process.versions.node.split('.')[0] is '0'
# Google Closure Compiler needs Node >= 4
{compiledCode: code} = require('google-closure-compiler-js').compile
jsCode: [
src: code
Expand Down Expand Up @@ -397,6 +398,24 @@ runTests = (CoffeeScript) ->

# Run every test in the `test` folder, recording failures.
files = fs.readdirSync 'test'
# If generator syntax isn’t supported (Node < 0.12 harmony), filter out the tests that use it.
try
new Function('(function*(){}())')()
catch
files.splice files.indexOf('generators.coffee'), 1
# If `for-of` syntax isn’t supported (Node < 0.12), filter out the tests that use it.
try
new Function('for (a of []) {}')()
catch
files.splice files.indexOf('arrays.coffee'), 1
files.splice files.indexOf('ranges.coffee'), 1
files.splice files.indexOf('scope.coffee'), 1
# If template literal syntax isn’t supported (Node < 4), filter out the tests that use it.
try
new Function('var a = ``')()
catch
files.splice files.indexOf('javascript_literals.coffee'), 1
files.splice files.indexOf('tagged_template_literals.coffee'), 1

for file in files when helpers.isCoffee file
literate = helpers.isLiterate file
Expand Down

0 comments on commit c5f4314

Please sign in to comment.