/
githubmirror
/
react-native
Обзор
Документация
Войти
/
githubmirror
/
react-native
Код
Запросы
0
Пакеты
0
Релизы
0
Аналитика
Безопасность
main
packages/react-native-codegen/e2e/namespaced/__tests__/components/GenerateShadowNodeCpp-test.js
35 строк
1 KB
Alex Hunt
Migrate Node.js builtin imports to node: scheme (#57611)
21 июл 2026, 19:01
21 июл 2026, 19:01
89300ac
Код
Авторство
О чём код?
/** * 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 */ 'use strict'; const generator = require('../../../../src/generators/components/GenerateShadowNodeCpp'); const {FlowParser} = require('../../../../src/parsers/flow/parser'); const fs = require('node:fs'); const FIXTURE_DIR = `${__dirname}/../../__test_fixtures__/components`; const fixtures = fs.readdirSync(FIXTURE_DIR); const parser = new FlowParser(); fixtures.forEach(fixture => { it(`GenerateShadowNodeCpp can generate for '${fixture}' using types under single namespace`, () => { const libName = 'RNCodegenModuleFixtures'; const schema = parser.parseFile(`${FIXTURE_DIR}/${fixture}`); const output = generator.generate( libName, schema, '', false, `react/renderer/components/${libName}/`, ); expect(Object.fromEntries(output)).toMatchSnapshot(); }); });