diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 43b69f8..8033855 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -8,7 +8,7 @@ jobs: strategy: matrix: - node-version: [10.x, 12.x, 13.x] + node-version: [10.x, 12.x, 13.x, 14.x, 15.x] steps: - uses: actions/checkout@v1 diff --git a/abstractTest.js b/abstractTest.js index 6f57447..0a7f24f 100644 --- a/abstractTest.js +++ b/abstractTest.js @@ -2,8 +2,8 @@ 'use strict' module.exports = function abstractTests (opts) { - var builder = opts.builder - var test = opts.test + const builder = opts.builder + const test = opts.test test('support on and emit', function (t) { t.plan(4) @@ -93,7 +93,7 @@ module.exports = function abstractTests (opts) { topic: 'hello world', payload: { my: 'message' } } - var toRemoveCalled = false + let toRemoveCalled = false function toRemove (message, cb) { toRemoveCalled = true @@ -395,7 +395,7 @@ module.exports = function abstractTests (opts) { test('close support', function (t) { const e = builder() - var check = false + let check = false t.notOk(e.closed, 'must have a false closed property') @@ -425,8 +425,8 @@ module.exports = function abstractTests (opts) { topic: 'hello/world', payload: { my: 'message' } } - var firstCalled = false - var secondCalled = false + let firstCalled = false + let secondCalled = false e.on('hello/#', function (message, cb) { t.notOk(firstCalled, 'first subscriber must only be called once') @@ -453,8 +453,8 @@ module.exports = function abstractTests (opts) { topic: 'hello/my/world', payload: { my: 'message' } } - var firstCalled = false - var secondCalled = false + let firstCalled = false + let secondCalled = false e.on('hello/#', function (message, cb) { t.notOk(firstCalled, 'first subscriber must only be called once') @@ -500,10 +500,10 @@ module.exports = function abstractTests (opts) { const total = 10000 const topic = 'test' - var received = 0 + let received = 0 e.on(topic, function (msg, cb) { - var fail = false + let fail = false if (received !== msg.payload) { t.fail(`leak detected. Count: ${received} - Payload: ${msg.payload}`) fail = true diff --git a/bench.js b/bench.js index e2edfc6..cfb9a34 100644 --- a/bench.js +++ b/bench.js @@ -3,8 +3,8 @@ const mqemitter = require('./') const emitter = mqemitter({ concurrency: 10 }) const total = 1000000 -var written = 0 -var received = 0 +let written = 0 +let received = 0 const timerKey = 'time for sending ' + total + ' messages' function write () { diff --git a/package.json b/package.json index 610345c..1daf9ad 100644 --- a/package.json +++ b/package.json @@ -7,7 +7,7 @@ "scripts": { "lint": "npm run lint:standard && npm run lint:typescript && npm run lint:markdown", "lint:standard": "standard --verbose | snazzy", - "lint:typescript": "standard --parser @typescript-eslint/parser --plugin @typescript-eslint/eslint-plugin test/types/*.ts mqemitter.d.ts", + "lint:typescript": "standard --parser @typescript-eslint/parser --plugin @typescript-eslint/eslint-plugin test/types/*.ts types/mqemitter.d.ts", "lint:markdown": "markdownlint README.md", "unit": "tape test/*.js", "unit:report": "nyc --reporter=html --reporter=cobertura --reporter=text tape test/*.js", @@ -51,7 +51,7 @@ "nyc": "^15.0.0", "pre-commit": "^1.2.2", "snazzy": "^9.0.0", - "standard": "^15.0.0", + "standard": "^16.0.0", "tape": "^5.0.1", "tsd": "^0.14.0", "typescript": "^4.0.2" diff --git a/test/test.js b/test/test.js index f620d85..7e8b567 100644 --- a/test/test.js +++ b/test/test.js @@ -12,7 +12,7 @@ test('queue concurrency', function (t) { t.plan(3) const e = mq({ concurrency: 1 }) - var completed1 = false + let completed1 = false t.equal(e.concurrency, 1) @@ -54,7 +54,7 @@ test('queue concurrency with overlapping subscriptions', function (t) { t.plan(3) const e = mq({ concurrency: 1 }) - var completed1 = false + let completed1 = false t.equal(e.concurrency, 1) diff --git a/test/types/index.ts b/test/types/index.ts index eb3c9c3..98457ab 100644 --- a/test/types/index.ts +++ b/test/types/index.ts @@ -5,7 +5,7 @@ import MQEmitter, { Message } from '../../types/mqemitter' const noop = function () {} -var mq = MQEmitter() +let mq = MQEmitter() mq = MQEmitter({ concurrency: 100 })