mirror of
https://github.com/hanzoai/core-js.git
synced 2026-09-24 16:58:15 +00:00
19 lines
690 B
JavaScript
19 lines
690 B
JavaScript
import { createIterable } from '../helpers/helpers.js';
|
|
|
|
import getIteratorMethod from 'core-js-pure/full/get-iterator-method';
|
|
|
|
QUnit.test('getIteratorMethod helper', assert => {
|
|
assert.isFunction(getIteratorMethod);
|
|
const iterable = createIterable([]);
|
|
const iterFn = getIteratorMethod(iterable);
|
|
assert.isFunction(iterFn);
|
|
assert.isIterator(iterFn.call(iterable));
|
|
assert.isFunction(getIteratorMethod([]));
|
|
assert.isFunction(getIteratorMethod(function () {
|
|
// eslint-disable-next-line prefer-rest-params -- required for testing
|
|
return arguments;
|
|
}()));
|
|
assert.isFunction(getIteratorMethod(Array.prototype));
|
|
assert.same(getIteratorMethod({}), undefined);
|
|
});
|