Skip to content

Commit

Permalink
chore(travis): update test matrix
Browse files Browse the repository at this point in the history
Update the test matrix to test newer versions of the Node.js runtime.
  • Loading branch information
terinjokes committed Jul 9, 2018
1 parent 14f1d71 commit e2462fa
Show file tree
Hide file tree
Showing 5 changed files with 84 additions and 92 deletions.
15 changes: 8 additions & 7 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -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
5 changes: 4 additions & 1 deletion index.js
Original file line number Diff line number Diff line change
Expand Up @@ -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;
40 changes: 18 additions & 22 deletions test/err.js
Original file line number Diff line number Diff line change
Expand Up @@ -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)({});

Expand Down Expand Up @@ -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: {
Expand Down
48 changes: 22 additions & 26 deletions test/minify.js
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand All @@ -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);
Expand Down
68 changes: 32 additions & 36 deletions test/sourcemap.js
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down Expand Up @@ -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);
Expand Down

0 comments on commit e2462fa

Please sign in to comment.