From 3fcde34a36c14ef6abd4d16dc5181b20a9a0b306 Mon Sep 17 00:00:00 2001 From: Alex Hunt Date: Mon, 29 Jun 2026 08:06:24 -0700 Subject: [PATCH] Relocate __typetests__ directory, format (#57367) Summary: Pull Request resolved: https://github.com/react/react-native/pull/57367 Places this one folder up, in a location that will be preserved when we later delete the manual `types/` dir. These tests already apply to both the `types/Libraries` dirs and the generated `types_generated/`. Changelog: [Internal] ___ Differential Revision: D110055787 fbshipit-source-id: 5ff190d301628877c9bda57c92b1af1a2917f1ca --- .../{types => }/__typetests__/animated.tsx | 0 .../__typetests__/fabric-component-sample.ts | 0 .../{types => }/__typetests__/globals.tsx | 0 .../{types => }/__typetests__/index.tsx | 0 .../__typetests__/legacy-properties.tsx | 0 .../__typetests__/stylesheet-create.tsx | 0 .../__typetests__/stylesheet-flatten.tsx | 0 .../__typetests__/turbo-module-sample.ts | 15 ++++++++------- packages/react-native/types/tsconfig.json | 3 ++- .../build-types/templates/tsconfig.test.json | 2 +- 10 files changed, 11 insertions(+), 9 deletions(-) rename packages/react-native/{types => }/__typetests__/animated.tsx (100%) rename packages/react-native/{types => }/__typetests__/fabric-component-sample.ts (100%) rename packages/react-native/{types => }/__typetests__/globals.tsx (100%) rename packages/react-native/{types => }/__typetests__/index.tsx (100%) rename packages/react-native/{types => }/__typetests__/legacy-properties.tsx (100%) rename packages/react-native/{types => }/__typetests__/stylesheet-create.tsx (100%) rename packages/react-native/{types => }/__typetests__/stylesheet-flatten.tsx (100%) rename packages/react-native/{types => }/__typetests__/turbo-module-sample.ts (65%) diff --git a/packages/react-native/types/__typetests__/animated.tsx b/packages/react-native/__typetests__/animated.tsx similarity index 100% rename from packages/react-native/types/__typetests__/animated.tsx rename to packages/react-native/__typetests__/animated.tsx diff --git a/packages/react-native/types/__typetests__/fabric-component-sample.ts b/packages/react-native/__typetests__/fabric-component-sample.ts similarity index 100% rename from packages/react-native/types/__typetests__/fabric-component-sample.ts rename to packages/react-native/__typetests__/fabric-component-sample.ts diff --git a/packages/react-native/types/__typetests__/globals.tsx b/packages/react-native/__typetests__/globals.tsx similarity index 100% rename from packages/react-native/types/__typetests__/globals.tsx rename to packages/react-native/__typetests__/globals.tsx diff --git a/packages/react-native/types/__typetests__/index.tsx b/packages/react-native/__typetests__/index.tsx similarity index 100% rename from packages/react-native/types/__typetests__/index.tsx rename to packages/react-native/__typetests__/index.tsx diff --git a/packages/react-native/types/__typetests__/legacy-properties.tsx b/packages/react-native/__typetests__/legacy-properties.tsx similarity index 100% rename from packages/react-native/types/__typetests__/legacy-properties.tsx rename to packages/react-native/__typetests__/legacy-properties.tsx diff --git a/packages/react-native/types/__typetests__/stylesheet-create.tsx b/packages/react-native/__typetests__/stylesheet-create.tsx similarity index 100% rename from packages/react-native/types/__typetests__/stylesheet-create.tsx rename to packages/react-native/__typetests__/stylesheet-create.tsx diff --git a/packages/react-native/types/__typetests__/stylesheet-flatten.tsx b/packages/react-native/__typetests__/stylesheet-flatten.tsx similarity index 100% rename from packages/react-native/types/__typetests__/stylesheet-flatten.tsx rename to packages/react-native/__typetests__/stylesheet-flatten.tsx diff --git a/packages/react-native/types/__typetests__/turbo-module-sample.ts b/packages/react-native/__typetests__/turbo-module-sample.ts similarity index 65% rename from packages/react-native/types/__typetests__/turbo-module-sample.ts rename to packages/react-native/__typetests__/turbo-module-sample.ts index b178fdcc51b..698bc125315 100644 --- a/packages/react-native/types/__typetests__/turbo-module-sample.ts +++ b/packages/react-native/__typetests__/turbo-module-sample.ts @@ -3,20 +3,21 @@ * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. + * + * @format */ -import { TurboModule, TurboModuleRegistry } from 'react-native'; -'use strict'; +import {TurboModule, TurboModuleRegistry} from 'react-native'; export interface SomeConstants { - x: string; - y: number; - z: boolean; + x: string; + y: number; + z: boolean; } export interface SampleSpec extends TurboModule { - getConstants(): SomeConstants - doSomething(): void; + getConstants(): SomeConstants; + doSomething(): void; } export default TurboModuleRegistry.getEnforcing('Sample'); diff --git a/packages/react-native/types/tsconfig.json b/packages/react-native/types/tsconfig.json index 8e8963ec2f6..bb7659500b1 100644 --- a/packages/react-native/types/tsconfig.json +++ b/packages/react-native/types/tsconfig.json @@ -12,5 +12,6 @@ "noEmit": true, "forceConsistentCasingInFileNames": true, "paths": {"react-native": ["."]} - } + }, + "include": ["**/*.d.ts", "../__typetests__/**/*"] } diff --git a/scripts/js-api/build-types/templates/tsconfig.test.json b/scripts/js-api/build-types/templates/tsconfig.test.json index 209586008a5..7af1dd074cb 100644 --- a/scripts/js-api/build-types/templates/tsconfig.test.json +++ b/scripts/js-api/build-types/templates/tsconfig.test.json @@ -13,5 +13,5 @@ "moduleResolution": "bundler", "customConditions": ["react-native-strict-api"] }, - "include": ["**/*.d.ts", "../types/__typetests__/**/*"] + "include": ["**/*.d.ts", "../__typetests__/**/*"] }