Skip to content

Commit

Permalink
tests for array + string iterators
Browse files Browse the repository at this point in the history
  • Loading branch information
aretecode committed Aug 20, 2017
1 parent 096fd4d commit 87bb563
Showing 1 changed file with 14 additions and 7 deletions.
21 changes: 14 additions & 7 deletions test/es6/index.js
Expand Up @@ -62,15 +62,22 @@ module.exports = function() {
});

it('should work for Set Iterator', function() {
var set = new Set().values();
assert.equal(kindOf(set), 'setiterator');
var SetValuesIterator = new Set().values();
assert.equal(kindOf(SetValuesIterator), 'setiterator');
});

it('should work for Map Iterator', function() {
var map = new Map().values();
assert.equal(kindOf(map), 'mapiterator');
});

var MapValuesIterator = new Map().values();
assert.equal(kindOf(MapValuesIterator), 'mapiterator');
});
it('should work for Array Iterator', function() {
var ArrayEntriesIterator = [].entries();
assert.equal(kindOf(ArrayEntriesIterator), 'arrayiterator');
})
it('should work for String Iterator', function() {
var StringCharIterator = ''[Symbol.iterator]();
assert.equal(kindOf(StringCharIterator), 'stringiterator');
})

it('should work for Symbol', function() {
assert.equal(kindOf(Symbol('foo')), 'symbol');
assert.equal(kindOf(Symbol.prototype), 'symbol');
Expand Down

0 comments on commit 87bb563

Please sign in to comment.