Skip to content

Commit

Permalink
Commit tests to std
Browse files Browse the repository at this point in the history
  • Loading branch information
Soremwar committed Feb 7, 2021
1 parent 9295fd1 commit 8e27eff
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 6 deletions.
7 changes: 1 addition & 6 deletions node/testdata/.gitignore
Original file line number Diff line number Diff line change
@@ -1,6 +1 @@
versions
suites

# Files ignored by the test suite must be put here so changes are carried over to
# the main repo
!suites/common/index.js
versions
23 changes: 23 additions & 0 deletions node/testdata/suites/parallel/test-event-emitter-listener-count.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
// deno-fmt-ignore-file
// deno-lint-ignore-file

// Copyright Joyent and Node contributors. All rights reserved. MIT license.

'use strict';

require('../common');
const assert = require('assert');
const EventEmitter = require('events');

const emitter = new EventEmitter();
emitter.on('foo', () => {});
emitter.on('foo', () => {});
emitter.on('baz', () => {});
// Allow any type
emitter.on(123, () => {});

assert.strictEqual(EventEmitter.listenerCount(emitter, 'foo'), 2);
assert.strictEqual(emitter.listenerCount('foo'), 2);
assert.strictEqual(emitter.listenerCount('bar'), 0);
assert.strictEqual(emitter.listenerCount('baz'), 1);
assert.strictEqual(emitter.listenerCount(123), 1);

0 comments on commit 8e27eff

Please sign in to comment.