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: #35496

PR-URL: #36002
Reviewed-By: Michaël Zasso <[email protected]>
Reviewed-By: Benjamin Gruenbaum <[email protected]>
  • Loading branch information
aduh95 authored and danielleadams committed Nov 10, 2020
1 parent 292915a commit 0a4c96a
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
Original file line number Diff line number Diff line change
@@ -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
Original file line number Diff line number Diff line change
@@ -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
Original file line number Diff line number Diff line change
@@ -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
Original file line number Diff line number Diff line change
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
Original file line number Diff line number Diff line change
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 0a4c96a

Please sign in to comment.