From e2462fa5fedf933db4d75183d1c693ed5c0c42c0 Mon Sep 17 00:00:00 2001 From: Terin Stock Date: Mon, 9 Jul 2018 12:03:04 -0700 Subject: [PATCH] chore(travis): update test matrix Update the test matrix to test newer versions of the Node.js runtime. --- .travis.yml | 15 ++++++----- index.js | 5 +++- test/err.js | 40 +++++++++++++--------------- test/minify.js | 48 +++++++++++++++------------------ test/sourcemap.js | 68 ++++++++++++++++++++++------------------------- 5 files changed, 84 insertions(+), 92 deletions(-) diff --git a/.travis.yml b/.travis.yml index f6b23fc..68d868e 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,16 +1,17 @@ language: node_js sudo: false node_js: - - 0.10 - - 0.12 - - 6 - - 7 + - '0.10' + - '0.12' + - '4' + - '6' + - '8' + - '10' matrix: include: - - node_js: 4 - env: LINT_TEST=true + - node_js: 10 + script: npm run lint script: - - "if [[ -n $LINT_TEST ]]; then npm run lint; fi" - npm run test after_success: - npm run coverage diff --git a/index.js b/index.js index 7cf4391..c9ad16b 100644 --- a/index.js +++ b/index.js @@ -5,7 +5,10 @@ var GulpUglifyError = require('./lib/gulp-uglify-error'); var logger = require('./lib/log'); module.exports = function(opts) { - return compose(uglify, logger)(opts); + return compose( + uglify, + logger + )(opts); }; module.exports.GulpUglifyError = GulpUglifyError; diff --git a/test/err.js b/test/err.js index 3a727a4..77250f8 100644 --- a/test/err.js +++ b/test/err.js @@ -25,18 +25,16 @@ describe('errors', function() { var err = new Error(); err.line = 28889; - td - .when( - uglify.minify( - { - 'test1.js': 'function errorFunction(error)\n{' - }, - expOptions - ) + td.when( + uglify.minify( + { + 'test1.js': 'function errorFunction(error)\n{' + }, + expOptions ) - .thenReturn({ - error: err - }); + ).thenReturn({ + error: err + }); var subject = minify(uglify, logger)({}); @@ -87,18 +85,16 @@ describe('errors', function() { }; var err = new Error('`exportAll` is not a supported option'); - td - .when( - uglify.minify( - { - 'test1.js': '{}' - }, - expOptions - ) + td.when( + uglify.minify( + { + 'test1.js': '{}' + }, + expOptions ) - .thenReturn({ - error: err - }); + ).thenReturn({ + error: err + }); var subject = minify(uglify, logger)({ output: { diff --git a/test/minify.js b/test/minify.js index 6dedc4c..7c3f429 100644 --- a/test/minify.js +++ b/test/minify.js @@ -28,20 +28,18 @@ describe('minify', function() { var uglify = td.object(['minify']); var logger = td.object(['warn']); - td - .when( - uglify.minify( - { - 'test1.js': testContentsInput - }, - { - output: {} - } - ) + td.when( + uglify.minify( + { + 'test1.js': testContentsInput + }, + { + output: {} + } ) - .thenReturn({ - code: 'foobar' - }); + ).thenReturn({ + code: 'foobar' + }); var subject = minify(uglify, logger)({}); var file = subject(this.testFile); @@ -60,20 +58,18 @@ describe('minify', function() { var uglify = td.object(['minify']); var logger = td.object(['warn']); - td - .when( - uglify.minify( - { - 'test1.js': testContentsInput - }, - { - output: {} - } - ) + td.when( + uglify.minify( + { + 'test1.js': testContentsInput + }, + { + output: {} + } ) - .thenReturn({ - code: 'foobar' - }); + ).thenReturn({ + code: 'foobar' + }); var subject = minify(uglify, logger)('build.min.js'); var file = subject(this.testFile); diff --git a/test/sourcemap.js b/test/sourcemap.js index 2c22767..963c494 100644 --- a/test/sourcemap.js +++ b/test/sourcemap.js @@ -36,26 +36,24 @@ describe('init-ed source maps', function() { var uglify = td.object(['minify']); var logger = td.object(['logger']); - td - .when( - uglify.minify( - { - 'test1.js': testContents1Input - }, - { - output: {}, - sourceMap: { - filename: 'test1.js', - includeSources: true, - content: testFile.sourceMap - } + td.when( + uglify.minify( + { + 'test1.js': testContents1Input + }, + { + output: {}, + sourceMap: { + filename: 'test1.js', + includeSources: true, + content: testFile.sourceMap } - ) + } ) - .thenReturn({ - code: 'foobar', - map: JSON.stringify(outMap.map) - }); + ).thenReturn({ + code: 'foobar', + map: JSON.stringify(outMap.map) + }); var subject = minify(uglify, logger)({}); var file = subject(testFile); @@ -99,26 +97,24 @@ describe('init-ed source maps', function() { var uglify = td.object(['minify']); var logger = td.object(['warn']); - td - .when( - uglify.minify( - { - 'test1.js': String(inMap) - }, - { - output: {}, - sourceMap: { - filename: 'test1.js', - includeSources: true, - content: testFile.sourceMap - } + td.when( + uglify.minify( + { + 'test1.js': String(inMap) + }, + { + output: {}, + sourceMap: { + filename: 'test1.js', + includeSources: true, + content: testFile.sourceMap } - ) + } ) - .thenReturn({ - code: 'send a PR changing this to the best La Croix flavor', - map: JSON.stringify(outMap.map) - }); + ).thenReturn({ + code: 'send a PR changing this to the best La Croix flavor', + map: JSON.stringify(outMap.map) + }); var subject = minify(uglify, logger)({}); var file = subject(testFile);