Skip to content

Commit

Permalink
drop support for unmaintained versions of Node.js; upgrade stuff (#3017)
Browse files Browse the repository at this point in the history
* 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
  • Loading branch information
boneskull authored Sep 27, 2017
1 parent 82c9cb4 commit e39a867
Show file tree
Hide file tree
Showing 16 changed files with 38 additions and 241 deletions.
1 change: 1 addition & 0 deletions .eslintignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,4 @@ coverage/
lib/to-iso-string/**/*.js
mocha.js
BUILDTMP
*.fixture.js
10 changes: 0 additions & 10 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,18 +21,8 @@ matrix:
env: TARGET=test-node
- node_js: '6'
env: TARGET=test-node
- node_js: '5'
env: TARGET=test-node
- node_js: '4'
env: TARGET=test-node
- node_js: 'iojs'
env: TARGET=test-node
- node_js: '0.12'
env: TARGET=test-node
- node_js: '0.11'
env: TARGET=test-node
- node_js: '0.10'
env: TARGET=test-node
- node_js: '8'
env: TARGET=lint
# phantomjs
Expand Down
5 changes: 3 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -77,11 +77,12 @@ test-compilers:
$(call test_node,compilers-coffee) --compilers coffee:coffee-script/register \
test/compiler

$(call test_node,compilers-custom) --compilers foo:./test/compiler-fixtures/foo \
$(call test_node,compilers-custom) \
--compilers foo:./test/compiler-fixtures/foo.fixture \
test/compiler

$(call test_node,compilers-multiple) \
--compilers coffee:coffee-script/register,foo:./test/compiler-fixtures/foo \
--compilers coffee:coffee-script/register,foo:./test/compiler-fixtures/foo.fixture \
test/compiler

test-requires:
Expand Down
2 changes: 0 additions & 2 deletions appveyor.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,6 @@ environment:
- nodejs_version: '7'
- nodejs_version: '6'
- nodejs_version: '4'
- nodejs_version: '0.12'
- nodejs_version: '0.10'
install:
- ps: Install-Product node $env:nodejs_version
- set CI=true
Expand Down
7 changes: 0 additions & 7 deletions lib/browser/debug.js

This file was deleted.

195 changes: 0 additions & 195 deletions lib/browser/events.js

This file was deleted.

5 changes: 5 additions & 0 deletions lib/browser/growl.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
'use strict';

// just stub out growl

module.exports = require('../utils').noop;
4 changes: 2 additions & 2 deletions lib/reporters/base.js
Original file line number Diff line number Diff line change
Expand Up @@ -120,8 +120,8 @@ exports.window = {

if (isatty) {
exports.window.width = process.stdout.getWindowSize
? process.stdout.getWindowSize(1)[0]
: tty.getWindowSize()[1];
? process.stdout.getWindowSize(1)[0]
: tty.getWindowSize()[1];
}

/**
Expand Down
4 changes: 2 additions & 2 deletions lib/runner.js
Original file line number Diff line number Diff line change
Expand Up @@ -229,7 +229,7 @@ Runner.prototype.fail = function (test, err) {
++this.failures;
test.state = 'failed';

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

Expand Down Expand Up @@ -722,7 +722,7 @@ Runner.prototype.uncaught = function (err) {
return;
}

// recover from hooks
// recover from hooks
if (runnable.type === 'hook') {
var errSuite = this.suite;
// if hook failure is in afterEach block
Expand Down
4 changes: 2 additions & 2 deletions lib/utils.js
Original file line number Diff line number Diff line change
Expand Up @@ -540,8 +540,8 @@ function jsonStringify (object, spaces, depth) {
--length;
str += '\n ' + repeat(' ', space) +
(isArray(object) ? '' : '"' + i + '": ') + // key
_stringify(object[i]) + // value
(length ? ',' : ''); // comma
_stringify(object[i]) + // value
(length ? ',' : ''); // comma
}

return str +
Expand Down
25 changes: 13 additions & 12 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -295,8 +295,8 @@
"_mocha": "./bin/_mocha"
},
"engines": {
"node": ">= 0.10.x",
"npm": ">= 1.4.x"
"node": ">= 4.0.0",
"npm": ">= 2.14.2"
},
"scripts": {
"lint": "eslint . bin/*",
Expand All @@ -307,11 +307,11 @@
"dependencies": {
"browser-stdout": "1.3.0",
"commander": "2.9.0",
"debug": "2.6.8",
"debug": "2.6.9",
"diff": "3.2.0",
"escape-string-regexp": "1.0.5",
"glob": "7.1.1",
"growl": "1.9.2",
"growl": "1.10.2",
"he": "1.1.1",
"json3": "3.3.2",
"lodash.create": "3.1.1",
Expand All @@ -325,25 +325,27 @@
"coffee-script": "^1.10.0",
"coveralls": "^2.11.15",
"cross-spawn": "^5.1.0",
"eslint": "^3.11.1",
"eslint-config-semistandard": "^7.0.0",
"eslint-config-standard": "^6.2.1",
"eslint": "^4.7.2",
"eslint-config-semistandard": "^11.0.0",
"eslint-config-standard": "^10.2.1",
"eslint-plugin-import": "^2.7.0",
"eslint-plugin-node": "^5.1.1",
"eslint-plugin-promise": "^3.4.0",
"eslint-plugin-standard": "2.0.1",
"eslint-plugin-standard": "^3.0.1",
"expect.js": "^0.3.1",
"karma": "1.3.0",
"karma-browserify": "^5.0.5",
"karma-chrome-launcher": "^2.0.0",
"karma-expect": "^1.1.2",
"karma-mocha": "^1.3.0",
"karma-phantomjs-launcher": "0.2.3",
"karma-spec-reporter": "0.0.26",
"karma-spec-reporter": "0.0.31",
"nyc": "^11.2.1",
"os-name": "^2.0.1",
"phantomjs": "1.9.8",
"readable-stream": "2.2.11",
"rimraf": "^2.5.2",
"should": "^9.0.2",
"should": "^13.1.0",
"through2": "^2.0.1",
"watchify": "^3.7.0"
},
Expand All @@ -359,8 +361,7 @@
"bower.json"
],
"browser": {
"debug": "./lib/browser/debug.js",
"events": "./lib/browser/events.js",
"growl": "./lib/browser/growl.js",
"tty": "./lib/browser/tty.js",
"./index.js": "./browser-entry.js",
"fs": false,
Expand Down
2 changes: 2 additions & 0 deletions test/.eslintrc.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,5 @@ env:
globals:
expect: false
assert: false
rules:
no-unused-expressions: off
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
'use strict';

var fs = require('fs');

require.extensions['.foo'] = function (module, filename) {
var content;
content = fs.readFileSync(filename, 'utf8');
Expand Down
2 changes: 1 addition & 1 deletion test/integration/compiler-globbing.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ var path = require('path');

describe('globbing like --compilers', function () {
it('should find a file of each type', function (done) {
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) {
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) {
if (error && !stdout) { return done(error); }
var results = JSON.parse(stdout);
expect(results).to.have.property('tests');
Expand Down
2 changes: 1 addition & 1 deletion test/integration/helpers.js
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ module.exports = {
} else if (!diffs.length || inStackTrace) {
// Haven't encountered a spec yet
// or we're in the middle of a stack trace
return;

} else if (line.indexOf('+ expected - actual') !== -1) {
inDiff = true;
} else if (line.match(/at Context/)) {
Expand Down
Loading

0 comments on commit e39a867

Please sign in to comment.