From 4f1ba79eb8c15cf85885d1f6af92cecc88ee51a3 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 9df6f78b6165cc..a2036ee7956fdf 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'); const { Event } = require('internal/event_target'); @@ -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 } }'); +}