You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
18 lines
447 B
JavaScript
18 lines
447 B
JavaScript
5 years ago
|
var test = require('tape');
|
||
|
var traverse = require('../');
|
||
|
var EventEmitter = require('events').EventEmitter;
|
||
|
|
||
|
test('check instanceof on node elems', function (t) {
|
||
|
var counts = { emitter : 0 };
|
||
|
|
||
|
traverse([ new EventEmitter, 3, 4, { ev : new EventEmitter }])
|
||
|
.forEach(function (node) {
|
||
|
if (node instanceof EventEmitter) counts.emitter ++;
|
||
|
})
|
||
|
;
|
||
|
|
||
|
t.equal(counts.emitter, 2);
|
||
|
|
||
|
t.end();
|
||
|
});
|