Skip to content

Commit

Permalink
test: adjust timeouts and set exit flag (#230)
Browse files Browse the repository at this point in the history
  • Loading branch information
JustinBeckwith authored Jan 4, 2021
1 parent cebea21 commit 1850490
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 15 deletions.
5 changes: 3 additions & 2 deletions .mocharc.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
{
"check-leaks": true,
"timeout": 60000,
"timeout": 2000,
"throw-deprecation": true,
"enable-source-maps": true
"enable-source-maps": true,
"exit": true
}
2 changes: 1 addition & 1 deletion src/queue.ts
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ export class Queue {
return;
}
const timer = setInterval(async () => {
if (this.activeTimers === 0 && this.q.size === 0) {
if (this.activeTimers === 0) {
await this.q.onIdle();
clearInterval(timer);
resolve();
Expand Down
15 changes: 3 additions & 12 deletions test/test.cli.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,10 @@ import * as util from 'util';
import enableDestroy = require('server-destroy');
import {LinkResult, LinkState} from '../src/index';

describe('cli', () => {
// eslint-disable-next-line prefer-arrow-callback
describe('cli', function () {
let server: http.Server;
this.timeout(30_000);

if (process.env.LINKINATOR_SKIP_CLI_TESTS) {
return;
Expand Down Expand Up @@ -142,17 +144,6 @@ describe('cli', () => {
assert.match(res.stderr, /FORMAT must be/);
});

it('should throw on invalid format', async () => {
const res = await execa(
'npx',
['linkinator', './README.md', '--format', 'LOL'],
{
reject: false,
}
);
assert.match(res.stderr, /FORMAT must be/);
});

it('should throw on invalid verbosity', async () => {
const res = await execa(
'npx',
Expand Down

0 comments on commit 1850490

Please sign in to comment.