/
githubmirror
/
babel
Обзор
Документация
Войти
/
githubmirror
/
babel
Код
Запросы
0
Пакеты
0
Релизы
0
Аналитика
Безопасность
main
packages/babel-plugin-proposal-function-sent/test/fixtures/function-sent/multiple/exec.js
23 строки
529 B
Deven Bansod
Migrate all remaining fixtures to jest expect
24 мар 2018, 13:52
24 мар 2018, 13:52
c8d82d6
Код
Авторство
О чём код?
const values = []; function* gen() { values.push(function.sent); values.push(function.sent); values.push(yield "foo"); values.push(function.sent); values.push(yield); values.push(function.sent); values.push(function.sent); } const it = gen(); expect(values).toEqual([]); expect(it.next(1).value).toBe("foo"); expect(values).toEqual([ 1, 1 ]); expect(it.next(2).value).toBeUndefined(); expect(values).toEqual([ 1, 1, 2, 2 ]); expect(it.next(3).done).toBe(true); expect(values).toEqual([ 1, 1, 2, 2, 3, 3, 3 ]);