From 0a4c96a7dfd6bc2f193a539f23538dda82f0df58 Mon Sep 17 00:00:00 2001 From: Antoine du Hamel Date: Fri, 6 Nov 2020 18:04:18 +0100 Subject: [PATCH] test: use global.EventTarget instead of internals MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit `EventTarget` is exposed on the global scope, there is no need to use `--expose-internals` flag in the tests. Refs: https://github.com/nodejs/node/pull/35496 PR-URL: https://github.com/nodejs/node/pull/36002 Reviewed-By: Michaƫl Zasso Reviewed-By: Benjamin Gruenbaum --- test/parallel/test-abortcontroller.js | 3 +-- test/parallel/test-eventtarget-once-twice.js | 5 ----- test/parallel/test-eventtarget-whatwg-once.js | 6 ------ test/parallel/test-eventtarget.js | 6 +----- test/parallel/test-nodeeventtarget.js | 5 +---- 5 files changed, 3 insertions(+), 22 deletions(-) diff --git a/test/parallel/test-abortcontroller.js b/test/parallel/test-abortcontroller.js index 9a43818220483a..8910ac7155762b 100644 --- a/test/parallel/test-abortcontroller.js +++ b/test/parallel/test-abortcontroller.js @@ -1,10 +1,9 @@ -// Flags: --no-warnings --expose-internals +// Flags: --no-warnings 'use strict'; const common = require('../common'); const { ok, strictEqual } = require('assert'); -const { Event } = require('internal/event_target'); { // Tests that abort is fired with the correct event type on AbortControllers diff --git a/test/parallel/test-eventtarget-once-twice.js b/test/parallel/test-eventtarget-once-twice.js index 6a38b80e2db75a..3358bab90e7569 100644 --- a/test/parallel/test-eventtarget-once-twice.js +++ b/test/parallel/test-eventtarget-once-twice.js @@ -1,10 +1,5 @@ -// Flags: --expose-internals --no-warnings 'use strict'; const common = require('../common'); -const { - Event, - EventTarget, -} = require('internal/event_target'); const { once } = require('events'); const et = new EventTarget(); diff --git a/test/parallel/test-eventtarget-whatwg-once.js b/test/parallel/test-eventtarget-whatwg-once.js index ba43c10916cfb7..95cbbbcf2ccaeb 100644 --- a/test/parallel/test-eventtarget-whatwg-once.js +++ b/test/parallel/test-eventtarget-whatwg-once.js @@ -1,13 +1,7 @@ -// Flags: --expose-internals --no-warnings 'use strict'; const common = require('../common'); -const { - Event, - EventTarget, -} = require('internal/event_target'); - const { strictEqual, } = require('assert'); diff --git a/test/parallel/test-eventtarget.js b/test/parallel/test-eventtarget.js index fa280027c61f29..91df453cfd409a 100644 --- a/test/parallel/test-eventtarget.js +++ b/test/parallel/test-eventtarget.js @@ -2,11 +2,7 @@ 'use strict'; const common = require('../common'); -const { - Event, - EventTarget, - defineEventHandler -} = require('internal/event_target'); +const { defineEventHandler } = require('internal/event_target'); const { ok, diff --git a/test/parallel/test-nodeeventtarget.js b/test/parallel/test-nodeeventtarget.js index 276bd9feb4da7c..6643584a6fc1d0 100644 --- a/test/parallel/test-nodeeventtarget.js +++ b/test/parallel/test-nodeeventtarget.js @@ -2,10 +2,7 @@ 'use strict'; const common = require('../common'); -const { - Event, - NodeEventTarget, -} = require('internal/event_target'); +const { NodeEventTarget } = require('internal/event_target'); const { deepStrictEqual,