From 7d7448782026dd3015f8471458c888b77c5f8db3 Mon Sep 17 00:00:00 2001 From: ZiJian Liu Date: Mon, 3 May 2021 14:48:16 +0800 Subject: [PATCH] test: increase coverage for AbortController MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Refs: https://coverage.nodejs.org/coverage-68e6673224365120/lib/internal/abort_controller.js.html#L126 PR-URL: https://github.com/nodejs/node/pull/38514 Reviewed-By: Antoine du Hamel Reviewed-By: Michaƫl Zasso Reviewed-By: Colin Ihrig Reviewed-By: Rich Trott Reviewed-By: James M Snell Reviewed-By: Darshan Sen --- test/parallel/test-abortcontroller.js | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/test/parallel/test-abortcontroller.js b/test/parallel/test-abortcontroller.js index 2f4fb495c75590..f7a70fbddbc89e 100644 --- a/test/parallel/test-abortcontroller.js +++ b/test/parallel/test-abortcontroller.js @@ -2,6 +2,7 @@ 'use strict'; const common = require('../common'); +const { inspect } = require('util'); const { ok, strictEqual, throws } = require('assert'); @@ -132,3 +133,11 @@ const { ok, strictEqual, throws } = require('assert'); ); } } + +{ + const ac = new AbortController(); + strictEqual(inspect(ac, { depth: 1 }), + 'AbortController { signal: [AbortSignal] }'); + strictEqual(inspect(ac, { depth: null }), + 'AbortController { signal: AbortSignal { aborted: false } }'); +}