diff --git a/bench/run.js b/bench/run.js index d0ad25d..05176b0 100644 --- a/bench/run.js +++ b/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, '..')); diff --git a/lib/assert.js b/lib/assert.js index d097e1b..ffe803b 100644 --- a/lib/assert.js +++ b/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; } diff --git a/lib/cli.js b/lib/cli.js index bb8d1d7..85c5a8c 100644 --- a/lib/cli.js +++ b/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({ diff --git a/lib/process-adapter.js b/lib/process-adapter.js index 240a4db..17babf9 100644 --- a/lib/process-adapter.js +++ b/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) { diff --git a/lib/reporters/mini.js b/lib/reporters/mini.js index 9f06007..38bfe46 100644 --- a/lib/reporters/mini.js +++ b/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'; diff --git a/lib/test.js b/lib/test.js index b3bce37..4ce145c 100644 --- a/lib/test.js +++ b/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]'; diff --git a/lib/watcher.js b/lib/watcher.js index 4206819..3d7094f 100644 --- a/lib/watcher.js +++ b/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; diff --git a/package.json b/package.json index b253817..eb49978 100644 --- a/package.json +++ b/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, diff --git a/test/concurrent.js b/test/concurrent.js index 8a6ac84..aa71c0f 100644 --- a/test/concurrent.js +++ b/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) { diff --git a/test/promise.js b/test/promise.js index 7a543b3..f90d9f9 100644 --- a/test/promise.js +++ b/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'); diff --git a/test/reporters/tap.js b/test/reporters/tap.js index c2c3a12..7a2eec0 100644 --- a/test/reporters/tap.js +++ b/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'}] } }); diff --git a/test/test.js b/test/test.js index c948151..792fde0 100644 --- a/test/test.js +++ b/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; diff --git a/test/visual/text-ends-at-terminal-width.js b/test/visual/text-ends-at-terminal-width.js index 6ee5267..843b62e 100644 --- a/test/visual/text-ends-at-terminal-width.js +++ b/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(); diff --git a/test/watcher.js b/test/watcher.js index 221ff87..0f47cef 100644 --- a/test/watcher.js +++ b/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'); diff --git a/types/make.js b/types/make.js index 9f2f675..ad08689 100644 --- a/types/make.js +++ b/types/make.js @@ -53,7 +53,7 @@ function generatePrefixed(prefix) { if (hasChildren(parts)) { chain = parts.join('_') + ''; } 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`; 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}`; } @@ -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 extends RegisterBase ${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]))