
エントリーの編集

エントリーの編集は全ユーザーに共通の機能です。
必ずガイドラインを一読の上ご利用ください。
Jest の beforeEach() / test() と Promise と setTimeout() の関係 - Qiita
記事へのコメント0件
- 注目コメント
- 新着コメント
このエントリーにコメントしてみましょう。
注目コメント算出アルゴリズムの一部にLINEヤフー株式会社の「建設的コメント順位付けモデルAPI」を使用しています

- バナー広告なし
- ミュート機能あり
- ダークモード搭載
関連記事
Jest の beforeEach() / test() と Promise と setTimeout() の関係 - Qiita
describe('async test', () => { let called; function promise() { console.log(called = 'function');... describe('async test', () => { let called; function promise() { console.log(called = 'function'); setTimeout(() => { console.log(called = 'setTimeout()'); }, 0); return new Promise(resolve => { console.log(called = 'Promise()'); resolve(); }).then(() => { console.log(called = 'then()'); }); } describe('test() only', () => { test('without await', () => { promise(); expect(called).toBe('Promise()');