Skip to content

Commit

Permalink
build(tests): fix coveralls and enable build cop (#175)
Browse files Browse the repository at this point in the history
7b703ce
commit 7b703ce
Author: Benjamin E. Coe <bencoe@google.com>
Date:   Mon Mar 23 10:55:24 2020 -0700

    build(tests): fix coveralls and enable build cop (#175)
  • Loading branch information
yoshi-automation committed Apr 1, 2020
1 parent 3694412 commit da4e60b
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 11 deletions.
6 changes: 0 additions & 6 deletions .mocharc.json

This file was deleted.

3 changes: 1 addition & 2 deletions samples/test/test.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,12 +16,11 @@ 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 () => {
const stdout = execSync('node quickstart.js');
assert.include(stdout, 'Well hello there, nodestronaut!');
});
});

2 changes: 1 addition & 1 deletion synth.metadata
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"updateTime": "2020-04-01T12:20:50.434391Z",
"updateTime": "2020-04-01T12:20:55.968161Z",
"sources": [
{
"git": {
Expand Down
8 changes: 6 additions & 2 deletions test/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -370,11 +370,15 @@ describe('callbackify', () => {
const error = new Error('err');
const callback = sinon.stub().throws(error);
const originalRejection = process.listeners('unhandledRejection').pop();
process.removeListener('unhandledRejection', originalRejection!);
if (originalRejection) {
process.removeListener('unhandledRejection', originalRejection!);
}
process.once('unhandledRejection', err => {
assert.strictEqual(error, err);
assert.ok(callback.calledOnce);
process.listeners('unhandledRejection').push(originalRejection!);
if (originalRejection) {
process.listeners('unhandledRejection').push(originalRejection!);
}
});
func(callback);
});
Expand Down

0 comments on commit da4e60b

Please sign in to comment.