/
githubmirror
/
gutenberg
Обзор
Документация
Войти
/
githubmirror
/
gutenberg
Код
Запросы
0
Пакеты
0
Релизы
0
Аналитика
Безопасность
trunk
packages/data-controls/src/test/index.js
19 строк
595 B
Marco Ciampini
ESLint: Remove legacy import suppressions (#81338)
07 авг 2026, 15:52
Не верифицирован
07 авг 2026, 15:52
8181ec4
Код
Авторство
О чём код?
import triggerFetch from '@wordpress/api-fetch'; jest.mock( '@wordpress/api-fetch' ); import { controls } from '../index'; describe( 'controls', () => { describe( 'API_FETCH', () => { afterEach( () => { triggerFetch.mockClear(); } ); it( 'invokes the triggerFetch function', () => { controls.API_FETCH( { request: '' } ); expect( triggerFetch ).toHaveBeenCalledTimes( 1 ); } ); it( 'invokes the triggerFetch function with the passed in request', () => { controls.API_FETCH( { request: 'foo' } ); expect( triggerFetch ).toHaveBeenCalledWith( 'foo' ); } ); } ); } );