Skip to content

Commit e39a867

Browse files
authored
drop support for unmaintained versions of Node.js; upgrade stuff (#3017)
* remove unmaintained versions of Node.js from CI * ignore test fixtures when linting * upgrade ESLint and its ilk * avoid fussing about Chai in test files * lint * upgrade should * upgrade karma-spec-reporter * upgrade growl and debug * update "engines" field in package.json * fix some bundling issues * allow debug in the browser * use browserify's eventemitter * stub growl
1 parent 82c9cb4 commit e39a867

16 files changed

+38
-241
lines changed

.eslintignore

+1
Original file line numberDiff line numberDiff line change
@@ -2,3 +2,4 @@ coverage/
22
lib/to-iso-string/**/*.js
33
mocha.js
44
BUILDTMP
5+
*.fixture.js

.travis.yml

-10
Original file line numberDiff line numberDiff line change
@@ -21,18 +21,8 @@ matrix:
2121
env: TARGET=test-node
2222
- node_js: '6'
2323
env: TARGET=test-node
24-
- node_js: '5'
25-
env: TARGET=test-node
2624
- node_js: '4'
2725
env: TARGET=test-node
28-
- node_js: 'iojs'
29-
env: TARGET=test-node
30-
- node_js: '0.12'
31-
env: TARGET=test-node
32-
- node_js: '0.11'
33-
env: TARGET=test-node
34-
- node_js: '0.10'
35-
env: TARGET=test-node
3626
- node_js: '8'
3727
env: TARGET=lint
3828
# phantomjs

Makefile

+3-2
Original file line numberDiff line numberDiff line change
@@ -77,11 +77,12 @@ test-compilers:
7777
$(call test_node,compilers-coffee) --compilers coffee:coffee-script/register \
7878
test/compiler
7979

80-
$(call test_node,compilers-custom) --compilers foo:./test/compiler-fixtures/foo \
80+
$(call test_node,compilers-custom) \
81+
--compilers foo:./test/compiler-fixtures/foo.fixture \
8182
test/compiler
8283

8384
$(call test_node,compilers-multiple) \
84-
--compilers coffee:coffee-script/register,foo:./test/compiler-fixtures/foo \
85+
--compilers coffee:coffee-script/register,foo:./test/compiler-fixtures/foo.fixture \
8586
test/compiler
8687

8788
test-requires:

appveyor.yml

-2
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,6 @@ environment:
44
- nodejs_version: '7'
55
- nodejs_version: '6'
66
- nodejs_version: '4'
7-
- nodejs_version: '0.12'
8-
- nodejs_version: '0.10'
97
install:
108
- ps: Install-Product node $env:nodejs_version
119
- set CI=true

lib/browser/debug.js

-7
This file was deleted.

lib/browser/events.js

-195
This file was deleted.

lib/browser/growl.js

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
'use strict';
2+
3+
// just stub out growl
4+
5+
module.exports = require('../utils').noop;

lib/reporters/base.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -120,8 +120,8 @@ exports.window = {
120120

121121
if (isatty) {
122122
exports.window.width = process.stdout.getWindowSize
123-
? process.stdout.getWindowSize(1)[0]
124-
: tty.getWindowSize()[1];
123+
? process.stdout.getWindowSize(1)[0]
124+
: tty.getWindowSize()[1];
125125
}
126126

127127
/**

lib/runner.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -229,7 +229,7 @@ Runner.prototype.fail = function (test, err) {
229229
++this.failures;
230230
test.state = 'failed';
231231

232-
if (!(err instanceof Error || err && typeof err.message === 'string')) {
232+
if (!((err instanceof Error || err) && typeof err.message === 'string')) {
233233
err = new Error('the ' + type(err) + ' ' + stringify(err) + ' was thrown, throw an Error :)');
234234
}
235235

@@ -722,7 +722,7 @@ Runner.prototype.uncaught = function (err) {
722722
return;
723723
}
724724

725-
// recover from hooks
725+
// recover from hooks
726726
if (runnable.type === 'hook') {
727727
var errSuite = this.suite;
728728
// if hook failure is in afterEach block

lib/utils.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -540,8 +540,8 @@ function jsonStringify (object, spaces, depth) {
540540
--length;
541541
str += '\n ' + repeat(' ', space) +
542542
(isArray(object) ? '' : '"' + i + '": ') + // key
543-
_stringify(object[i]) + // value
544-
(length ? ',' : ''); // comma
543+
_stringify(object[i]) + // value
544+
(length ? ',' : ''); // comma
545545
}
546546

547547
return str +

package.json

+13-12
Original file line numberDiff line numberDiff line change
@@ -295,8 +295,8 @@
295295
"_mocha": "./bin/_mocha"
296296
},
297297
"engines": {
298-
"node": ">= 0.10.x",
299-
"npm": ">= 1.4.x"
298+
"node": ">= 4.0.0",
299+
"npm": ">= 2.14.2"
300300
},
301301
"scripts": {
302302
"lint": "eslint . bin/*",
@@ -307,11 +307,11 @@
307307
"dependencies": {
308308
"browser-stdout": "1.3.0",
309309
"commander": "2.9.0",
310-
"debug": "2.6.8",
310+
"debug": "2.6.9",
311311
"diff": "3.2.0",
312312
"escape-string-regexp": "1.0.5",
313313
"glob": "7.1.1",
314-
"growl": "1.9.2",
314+
"growl": "1.10.2",
315315
"he": "1.1.1",
316316
"json3": "3.3.2",
317317
"lodash.create": "3.1.1",
@@ -325,25 +325,27 @@
325325
"coffee-script": "^1.10.0",
326326
"coveralls": "^2.11.15",
327327
"cross-spawn": "^5.1.0",
328-
"eslint": "^3.11.1",
329-
"eslint-config-semistandard": "^7.0.0",
330-
"eslint-config-standard": "^6.2.1",
328+
"eslint": "^4.7.2",
329+
"eslint-config-semistandard": "^11.0.0",
330+
"eslint-config-standard": "^10.2.1",
331+
"eslint-plugin-import": "^2.7.0",
332+
"eslint-plugin-node": "^5.1.1",
331333
"eslint-plugin-promise": "^3.4.0",
332-
"eslint-plugin-standard": "2.0.1",
334+
"eslint-plugin-standard": "^3.0.1",
333335
"expect.js": "^0.3.1",
334336
"karma": "1.3.0",
335337
"karma-browserify": "^5.0.5",
336338
"karma-chrome-launcher": "^2.0.0",
337339
"karma-expect": "^1.1.2",
338340
"karma-mocha": "^1.3.0",
339341
"karma-phantomjs-launcher": "0.2.3",
340-
"karma-spec-reporter": "0.0.26",
342+
"karma-spec-reporter": "0.0.31",
341343
"nyc": "^11.2.1",
342344
"os-name": "^2.0.1",
343345
"phantomjs": "1.9.8",
344346
"readable-stream": "2.2.11",
345347
"rimraf": "^2.5.2",
346-
"should": "^9.0.2",
348+
"should": "^13.1.0",
347349
"through2": "^2.0.1",
348350
"watchify": "^3.7.0"
349351
},
@@ -359,8 +361,7 @@
359361
"bower.json"
360362
],
361363
"browser": {
362-
"debug": "./lib/browser/debug.js",
363-
"events": "./lib/browser/events.js",
364+
"growl": "./lib/browser/growl.js",
364365
"tty": "./lib/browser/tty.js",
365366
"./index.js": "./browser-entry.js",
366367
"fs": false,

test/.eslintrc.yaml

+2
Original file line numberDiff line numberDiff line change
@@ -3,3 +3,5 @@ env:
33
globals:
44
expect: false
55
assert: false
6+
rules:
7+
no-unused-expressions: off

test/compiler-fixtures/foo.js renamed to test/compiler-fixtures/foo.fixture.js

+1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
'use strict';
22

33
var fs = require('fs');
4+
45
require.extensions['.foo'] = function (module, filename) {
56
var content;
67
content = fs.readFileSync(filename, 'utf8');

test/integration/compiler-globbing.spec.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ var path = require('path');
66

77
describe('globbing like --compilers', function () {
88
it('should find a file of each type', function (done) {
9-
exec('"' + process.execPath + '" "' + path.join('bin', 'mocha') + '" -R json --require coffee-script/register --require test/compiler-fixtures/foo "test/compiler/*.@(coffee|foo)"', { cwd: path.join(__dirname, '..', '..') }, function (error, stdout) {
9+
exec('"' + process.execPath + '" "' + path.join('bin', 'mocha') + '" -R json --require coffee-script/register --require test/compiler-fixtures/foo.fixture "test/compiler/*.@(coffee|foo)"', { cwd: path.join(__dirname, '..', '..') }, function (error, stdout) {
1010
if (error && !stdout) { return done(error); }
1111
var results = JSON.parse(stdout);
1212
expect(results).to.have.property('tests');

test/integration/helpers.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,7 @@ module.exports = {
8989
} else if (!diffs.length || inStackTrace) {
9090
// Haven't encountered a spec yet
9191
// or we're in the middle of a stack trace
92-
return;
92+
9393
} else if (line.indexOf('+ expected - actual') !== -1) {
9494
inDiff = true;
9595
} else if (line.match(/at Context/)) {

0 commit comments

Comments
 (0)