From 75208dc6511ec23ef373e22bd399d571b3669a15 Mon Sep 17 00:00:00 2001 From: bcoe Date: Mon, 23 Mar 2020 10:30:38 -0700 Subject: [PATCH] chore: fix linting --- samples/test/test.js | 3 +-- test/index.ts | 6 ++++-- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/samples/test/test.js b/samples/test/test.js index 58363cd..6331a6c 100644 --- a/samples/test/test.js +++ b/samples/test/test.js @@ -16,7 +16,7 @@ const {assert} = require('chai'); const {describe, it} = require('mocha'); const cp = require('child_process'); -const execSync = cmd => cp.execSync(cmd, {encoding: 'utf-8'}); +const execSync = (cmd) => cp.execSync(cmd, {encoding: 'utf-8'}); describe('quickstart samples', () => { it('should run the quickstart', async () => { @@ -24,4 +24,3 @@ describe('quickstart samples', () => { assert.include(stdout, 'Well hello there, nodestronaut!'); }); }); - diff --git a/test/index.ts b/test/index.ts index cf505e4..267b9f2 100644 --- a/test/index.ts +++ b/test/index.ts @@ -370,13 +370,15 @@ describe('callbackify', () => { const error = new Error('err'); const callback = sinon.stub().throws(error); const originalRejection = process.listeners('unhandledRejection').pop(); - if (originalRejection) + if (originalRejection) { process.removeListener('unhandledRejection', originalRejection!); + } process.once('unhandledRejection', err => { assert.strictEqual(error, err); assert.ok(callback.calledOnce); - if (originalRejection) + if (originalRejection) { process.listeners('unhandledRejection').push(originalRejection!); + } }); func(callback); });