text: import { createIterator } from '../helpers/helpers';
  import { STRICT_THIS } from '../helpers/constants';
  
  import AsyncIterator from 'core-js-pure/features/async-iterator';
  
  QUnit.test('AsyncIterator#map', assert => {
    assert.expect(15);
    const async = assert.async();
    const { map } = AsyncIterator.prototype;
  
    assert.isFunction(map);
    assert.arity(map, 1);
    assert.nonEnumerable(AsyncIterator.prototype, 'map');
  
    map.call(createIterator([1, 2, 3]), it => it ** 2).toArray().then(it => {
      assert.arrayEqual(it, [1, 4, 9], 'basic functionality');
      return map.call(createIterator([1]), function (arg) {
        assert.same(this, STRICT_THIS, 'this');
        assert.same(arguments.length, 1, 'arguments length');
        assert.same(arg, 1, 'argument');
      }).toArray();
    }).then(() => {
      return map.call(createIterator([1]), () => { throw 42; }).toArray();
    }).catch(error => {
      assert.same(error, 42, 'rejection on a callback error');
    }).then(() => async());
  
    assert.throws(() => map.call(undefined, () => { /* empty */ }), TypeError);
    assert.throws(() => map.call(null, () => { /* empty */ }), TypeError);
    assert.throws(() => map.call({}, () => { /* empty */ }), TypeError);
    assert.throws(() => map.call([], () => { /* empty */ }), TypeError);
    assert.throws(() => map.call(createIterator([1]), undefined), TypeError);
    assert.throws(() => map.call(createIterator([1]), null), TypeError);
    assert.throws(() => map.call(createIterator([1]), {}), TypeError);
  });
  