mirror of
https://github.com/hanzoai/core-js.git
synced 2026-09-24 16:58:15 +00:00
22 lines
636 B
JavaScript
22 lines
636 B
JavaScript
import { STRICT } from '../helpers/constants.js';
|
|
import { createIterator } from '../helpers/helpers.js';
|
|
|
|
QUnit.test('AsyncIterator#toArray', assert => {
|
|
const { toArray } = AsyncIterator.prototype;
|
|
|
|
assert.isFunction(toArray);
|
|
assert.arity(toArray, 0);
|
|
assert.name(toArray, 'toArray');
|
|
assert.looksNative(toArray);
|
|
assert.nonEnumerable(AsyncIterator.prototype, 'toArray');
|
|
|
|
if (STRICT) {
|
|
assert.throws(() => toArray.call(undefined), TypeError);
|
|
assert.throws(() => toArray.call(null), TypeError);
|
|
}
|
|
|
|
return toArray.call(createIterator([1, 2, 3])).then(it => {
|
|
assert.arrayEqual(it, [1, 2, 3]);
|
|
});
|
|
});
|