Skip to content

Commit

Permalink
test: increase coverage for AbortController
Browse files Browse the repository at this point in the history
Refs: https://coverage.nodejs.org/coverage-68e6673224365120/lib/internal/abort_controller.js.html#L126

PR-URL: #38514
Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com>
Reviewed-By: Michaël Zasso <targos@protonmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Rich Trott <rtrott@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Darshan Sen <raisinten@gmail.com>
  • Loading branch information
Lxxyx authored and targos committed Jun 11, 2021
1 parent 4c67437 commit 4f1ba79
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions test/parallel/test-abortcontroller.js
Expand Up @@ -2,6 +2,7 @@
'use strict';

const common = require('../common');
const { inspect } = require('util');

const { ok, strictEqual, throws } = require('assert');
const { Event } = require('internal/event_target');
Expand Down Expand Up @@ -133,3 +134,11 @@ const { Event } = require('internal/event_target');
);
}
}

{
const ac = new AbortController();
strictEqual(inspect(ac, { depth: 1 }),
'AbortController { signal: [AbortSignal] }');
strictEqual(inspect(ac, { depth: null }),
'AbortController { signal: AbortSignal { aborted: false } }');
}

0 comments on commit 4f1ba79

Please sign in to comment.