Browse Source

Bump dependencies and fix lint issues

master
Sindre Sorhus 8 years ago
parent
commit
3da8603b87
  1. 1
      bench/run.js
  2. 4
      lib/assert.js
  3. 2
      lib/cli.js
  4. 3
      lib/process-adapter.js
  5. 2
      lib/reporters/mini.js
  6. 2
      lib/test.js
  7. 8
      lib/watcher.js
  8. 12
      package.json
  9. 1
      test/concurrent.js
  10. 3
      test/promise.js
  11. 2
      test/reporters/tap.js
  12. 1
      test/test.js
  13. 2
      test/visual/text-ends-at-terminal-width.js
  14. 2
      test/watcher.js
  15. 8
      types/make.js

1
bench/run.js

@ -3,7 +3,6 @@ const childProcess = require('child_process');
const path = require('path');
const fs = require('fs');
const arrify = require('arrify');
const Promise = require('bluebird');
const mkdirp = require('mkdirp');
const branch = require('git-branch').sync(path.join(__dirname, '..'));

4
lib/assert.js

@ -209,9 +209,7 @@ function wrapAssertions(callbacks) {
if (promise) {
const result = promise
.then(
noop,
reason => test(makeRethrow(reason)));
.then(noop, reason => test(makeRethrow(reason)));
pending(this, result);
return result;
}

2
lib/cli.js

@ -121,7 +121,7 @@ exports.run = () => {
throw new Error(colors.error(figures.cross) + ' The --require and -r flags are deprecated. Requirements should be configured in package.json - see documentation.');
}
// copy resultant cli.flags into conf for use with Api and elsewhere
// Copy resultant cli.flags into conf for use with Api and elsewhere
Object.assign(conf, cli.flags);
const api = new Api({

3
lib/process-adapter.js

@ -32,7 +32,8 @@ exports.emit = process.emit.bind(process);
exports.exit = process.exit.bind(process);
exports.env = process.env;
const opts = exports.opts = JSON.parse(process.argv[2]);
const opts = JSON.parse(process.argv[2]);
exports.opts = opts;
// Fake TTY support
if (opts.tty) {

2
lib/reporters/mini.js

@ -14,7 +14,7 @@ const codeExcerpt = require('../code-excerpt');
const colors = require('../colors');
// TODO(@jamestalamge): This should be fixed in log-update and ansi-escapes once we are confident it's a good solution.
const CSI = '\u001b[';
const CSI = '\u001B[';
const ERASE_LINE = CSI + '2K';
const CURSOR_TO_COLUMN_0 = CSI + '0G';
const CURSOR_UP = CSI + '1A';

2
lib/test.js

@ -94,7 +94,7 @@ class Test {
}
if (typeof fn !== 'function') {
throw new Error('You must provide a callback');
throw new TypeError('You must provide a callback');
}
this.title = title || fnName(fn) || '[anonymous]';

8
lib/watcher.js

@ -28,7 +28,7 @@ class Debouncer {
return;
}
const timer = this.timer = setTimeout(() => {
const timer = setTimeout(() => {
this.watcher.busy.then(() => {
// Do nothing if debouncing was canceled while waiting for the busy
// promise to fulfil
@ -47,6 +47,8 @@ class Debouncer {
}
});
}, 10);
this.timer = timer;
}
cancel() {
if (this.timer) {
@ -90,7 +92,9 @@ class Watcher {
logger.start();
}
const currentVector = this.runVector += 1;
this.runVector += 1;
const currentVector = this.runVector;
let runOnlyExclusive = false;

12
package.json

@ -122,7 +122,7 @@
"figures": "^2.0.0",
"find-cache-dir": "^0.1.1",
"fn-name": "^2.0.0",
"get-port": "^2.1.0",
"get-port": "^3.0.0",
"globby": "^6.0.0",
"has-flag": "^2.0.0",
"hullabaloo-config-manager": "^0.2.0",
@ -148,7 +148,7 @@
"mkdirp": "^0.5.1",
"ms": "^0.7.1",
"multimatch": "^2.1.0",
"observable-to-promise": "^0.4.0",
"observable-to-promise": "^0.5.0",
"option-chain": "^0.1.0",
"package-hash": "^2.0.0",
"pkg-conf": "^2.0.0",
@ -171,7 +171,7 @@
"coveralls": "^2.11.4",
"delay": "^1.3.0",
"execa": "^0.6.0",
"flow-bin": "^0.40.0",
"flow-bin": "^0.42.0",
"get-stream": "^3.0.0",
"git-branch": "^0.3.0",
"has-ansi": "^2.0.0",
@ -182,13 +182,13 @@
"proxyquire": "^1.7.4",
"rimraf": "^2.5.0",
"signal-exit": "^3.0.0",
"sinon": "^1.17.2",
"sinon": "^2.0.0",
"source-map-fixtures": "^2.1.0",
"tap": "^10.0.0",
"temp-write": "^3.1.0",
"touch": "^1.0.0",
"xo": "^0.17.0",
"zen-observable": "^0.4.0"
"xo": "^0.18.0",
"zen-observable": "^0.5.1"
},
"xo": {
"esnext": true,

1
test/concurrent.js

@ -1,6 +1,5 @@
'use strict';
const test = require('tap').test;
const Promise = require('bluebird');
const Concurrent = require('../lib/concurrent');
function pass(val) {

3
test/promise.js

@ -213,7 +213,7 @@ test('does not handle throws with string reject', t => {
ava(a => {
a.plan(1);
const promise = Promise.reject('abc');
const promise = Promise.reject('abc'); // eslint-disable-line prefer-promise-reject-errors
return a.throws(promise, 'abc');
}).run().then(result => {
t.is(result.passed, false);
@ -300,6 +300,7 @@ test('reject', t => {
});
test('reject with non-Error', t => {
// eslint-disable-next-line prefer-promise-reject-errors
ava(() => Promise.reject('failure')).run().then(result => {
t.is(result.passed, false);
t.is(result.reason.name, 'AssertionError');

2
test/reporters/tap.js

@ -92,7 +92,7 @@ test('strips ANSI from actual and expected values', t => {
title: 'strip ansi',
error: {
avaAssertionError: true,
values: [{label: 'value', formatted: '\u001b[31mhello\u001b[39m'}]
values: [{label: 'value', formatted: '\u001B[31mhello\u001B[39m'}]
}
});

1
test/test.js

@ -1,6 +1,5 @@
'use strict';
const test = require('tap').test;
const Promise = global.Promise = require('bluebird');
const delay = require('delay');
const isPromise = require('is-promise');
const formatValue = require('../lib/format-assert-error').formatValue;

2
test/visual/text-ends-at-terminal-width.js

@ -7,7 +7,7 @@ function writeFullWidth(even, adjust) {
const len = Math[even ? 'floor' : 'ceil']((process.stdout.columns + adjust) / 2);
for (let i = 0; i < len; i++) {
process.stdout.write(String(i % 10));
await delay(1);
await delay(1); // eslint-disable-line no-await-in-loop
}
await delay(200);
t.pass();

2
test/watcher.js

@ -1,8 +1,8 @@
/* eslint-disable promise/no-callback-in-promise */
'use strict';
const path = require('path');
const EventEmitter = require('events');
const PassThrough = require('stream').PassThrough;
const Promise = require('bluebird');
const defaultIgnore = require('ignore-by-default').directories();
const lolex = require('lolex');
const proxyquire = require('proxyquire');

8
types/make.js

@ -53,7 +53,7 @@ function generatePrefixed(prefix) {
if (hasChildren(parts)) {
chain = parts.join('_') + '<T>';
} else {
// this is a single function, not a namespace, so there's no type associated
// This is a single function, not a namespace, so there's no type associated
// and we need to dereference it as a property type
const last = parts.pop();
const joined = parts.join('_');
@ -77,7 +77,7 @@ function generatePrefixed(prefix) {
output += `\t${part}: RegisterBase<T>`;
if (hasChildren(parts)) {
// this chain can be continued, make the property an intersection type with the chain continuation
// This chain can be continued, make the property an intersection type with the chain continuation
const joined = parts.join('_');
output += ` & Register_${joined}<T>`;
}
@ -96,7 +96,7 @@ function generatePrefixed(prefix) {
const typeBody = `{\n${output}}\n${children}`;
if (prefix.length === 0) {
// no prefix, so this is the type for the default export
// No prefix, so this is the type for the default export
return `export interface Register<T> extends RegisterBase<T> ${typeBody}`;
}
const namespace = ['Register'].concat(prefix).join('_');
@ -148,7 +148,7 @@ function verify(parts, asPrefix) {
// Returns true if a chain can have any child properties
function hasChildren(parts) {
// concatenate the chain with each other part, and see if any concatenations are valid functions
// Concatenate the chain with each other part, and see if any concatenations are valid functions
const validChildren = allParts
.filter(newPart => parts.indexOf(newPart) === -1)
.map(newPart => parts.concat([newPart]))

Loading…
Cancel
Save