/
githubmirror
/
wp-calypso
Обзор
Документация
Войти
/
githubmirror
/
wp-calypso
Код
Задачи
Вики
Пакеты
0
Релизы
0
Аналитика
Безопасность
trunk
test/server/setup-test-framework.js
23 строки
532 B
Marin Atanasov
Framework: Say goodbye to chai (#63807)
19 май 2022, 14:23
Не верифицирован
19 май 2022, 14:23
67d86c2
Код
Авторство
О чём код?
import * as nock from 'nock'; // Disables all network requests for all tests. nock.disableNetConnect(); beforeAll( () => { // reactivate nock on test start if ( ! nock.isActive() ) { nock.activate(); } } ); afterAll( () => { // helps clean up nock after each test run and avoid memory leaks nock.restore(); nock.cleanAll(); } ); // Don't need to mock specific functions for any tests, but mocking // module because it accesses the `document` global. jest.mock( 'wpcom-proxy-request', () => ( { __esModule: true, } ) );