From 411d1ab2f4e32a551da889ec0ed8a4cef39758d5 Mon Sep 17 00:00:00 2001 From: ZiJian Liu Date: Mon, 3 May 2021 14:48:16 +0800 Subject: [PATCH 1/2] test: increase coverage for AbortController Refs: https://coverage.nodejs.org/coverage-68e6673224365120/lib/internal/abort_controller.js.html#L126 --- test/parallel/test-abortcontroller.js | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/test/parallel/test-abortcontroller.js b/test/parallel/test-abortcontroller.js index 2f4fb495c75590..81ae0e57048921 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,10 @@ 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 } }'); +} From b4eb4a88eef1ba17f6ce4b2b5b2db2a975c45aa2 Mon Sep 17 00:00:00 2001 From: ZiJian Liu Date: Mon, 3 May 2021 14:53:50 +0800 Subject: [PATCH 2/2] fixup! lint --- test/parallel/test-abortcontroller.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/test/parallel/test-abortcontroller.js b/test/parallel/test-abortcontroller.js index 81ae0e57048921..f7a70fbddbc89e 100644 --- a/test/parallel/test-abortcontroller.js +++ b/test/parallel/test-abortcontroller.js @@ -136,7 +136,8 @@ const { ok, strictEqual, throws } = require('assert'); { const ac = new AbortController(); - strictEqual(inspect(ac, { depth: 1 }), 'AbortController { signal: [AbortSignal] }'); + strictEqual(inspect(ac, { depth: 1 }), + 'AbortController { signal: [AbortSignal] }'); strictEqual(inspect(ac, { depth: null }), 'AbortController { signal: AbortSignal { aborted: false } }'); }