/
githubmirror
/
react-native
Обзор
Документация
Войти
/
githubmirror
/
react-native
Код
Запросы
0
Пакеты
0
Релизы
0
Аналитика
Безопасность
main
private/react-native-fantom/src/__tests__/setup/scoping-itest.js
47 строк
1 KB
Tim Yung
RN: Move `{packages => private}/react-native-fantom` (#51938)
12 июн 2025, 09:49
12 июн 2025, 09:49
d6f29c8
Код
Авторство
О чём код?
/** * Copyright (c) Meta Platforms, Inc. and affiliates. * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. * * @flow strict-local * @format */ const logs: string[] = []; const log = (message: string): void => { logs.push(message); }; beforeAll(() => log('1 - beforeAll')); afterAll(() => { log('1 - afterAll'); // Source https://jestjs.io/docs/setup-teardown#scoping expect(logs).toEqual([ '1 - beforeAll', '1 - beforeEach', '1 - test', '1 - afterEach', '2 - beforeAll', '1 - beforeEach', '2 - beforeEach', '2 - test', '2 - afterEach', '1 - afterEach', '2 - afterAll', '1 - afterAll', ]); }); beforeEach(() => log('1 - beforeEach')); afterEach(() => log('1 - afterEach')); test('root', () => log('1 - test')); describe('Scoped / Nested block', () => { beforeAll(() => log('2 - beforeAll')); afterAll(() => log('2 - afterAll')); beforeEach(() => log('2 - beforeEach')); afterEach(() => log('2 - afterEach')); test('inner', () => log('2 - test')); });