Skip to content

Commit

Permalink
test: use global.EventTarget instead of internals
Browse files Browse the repository at this point in the history
`EventTarget` is exposed on the global scope, there is no need to use
`--expose-internals` flag in the tests.

Refs: nodejs#35496

PR-URL: nodejs#36002
Reviewed-By: Michaël Zasso <targos@protonmail.com>
Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com>
  • Loading branch information
aduh95 committed Nov 9, 2020
1 parent b589128 commit 36fbbe0
Show file tree
Hide file tree
Showing 5 changed files with 3 additions and 22 deletions.
3 changes: 1 addition & 2 deletions 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
Expand Down
5 changes: 0 additions & 5 deletions 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();
Expand Down
6 changes: 0 additions & 6 deletions 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');
Expand Down
6 changes: 1 addition & 5 deletions test/parallel/test-eventtarget.js
Expand Up @@ -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,
Expand Down
5 changes: 1 addition & 4 deletions test/parallel/test-nodeeventtarget.js
Expand Up @@ -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,
Expand Down

0 comments on commit 36fbbe0

Please sign in to comment.