/
githubmirror
/
jest
Обзор
Документация
Войти
/
githubmirror
/
jest
Код
Запросы
0
Пакеты
0
Релизы
0
Аналитика
Безопасность
main
e2e/__tests__/runtimeInternalModuleRegistry.test.ts
27 строк
1 KB
pengqiseven
chore: remove redundant word in comment (#15602)
22 май 2025, 10:24
Не верифицирован
22 май 2025, 10:24
c5e5ee8
Код
Авторство
О чём код?
/** * 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. */ import {json as runWithJson} from '../runJest'; describe('Runtime Internal Module Registry', () => { // Previously, if Jest required a module (e.g. requiring `mkdirp` from // `jest-util`) and the project *using* Jest also required that module, Jest // wouldn't re-require it and thus ignored any mocks that the module may have // used. // // This test verifies that behavior doesn't happen anymore, and correctly // uses two module registries: an internal registry that's used specifically by // Jest to require any internal modules used when setting up the test // environment, and a "normal" module registry that's used by the actual test // code (and can safely be cleared after every test) it('correctly makes use of internal module registry when requiring modules', () => { const {json} = runWithJson('runtime-internal-module-registry', []); expect(json.numTotalTests).toBe(1); expect(json.numPassedTests).toBe(1); }); });