From daefa526ad140db3f02c14a0c61463f856ce0032 Mon Sep 17 00:00:00 2001 From: Ramanpreet Nara Date: Fri, 15 Jan 2021 11:57:12 -0800 Subject: [PATCH] Clean up babel-plugin-codegen snapshot tests Summary: Forgot to delete these snapshot tests in D25915169 (https://github.com/facebook/react-native/commit/e67fc7cadadab065901fc67d5f1485c696197362). They are no longer necessary, because we're deleting the JS TurboModule codegen. Changelog: [Internal] Reviewed By: mdvacca Differential Revision: D25920310 fbshipit-source-id: 66f6fa3fcba5b53210798a204e4f76e4595b3f25 --- .../__test_fixtures__/fixtures.js | 64 ------------------- .../__snapshots__/index-test.js.snap | 51 --------------- 2 files changed, 115 deletions(-) diff --git a/packages/babel-plugin-codegen/__test_fixtures__/fixtures.js b/packages/babel-plugin-codegen/__test_fixtures__/fixtures.js index 31449e97abe..946b622ea87 100644 --- a/packages/babel-plugin-codegen/__test_fixtures__/fixtures.js +++ b/packages/babel-plugin-codegen/__test_fixtures__/fixtures.js @@ -103,72 +103,8 @@ export default (codegenNativeComponent('Module', { }): NativeType); `; -const SAMPLE_TURBO_MODULE_SINGLE_DEFAULT_EXPORT = ` -// @flow - -import type {RootTag, TurboModule} from '../RCTExport'; -import * as TurboModuleRegistry from '../TurboModuleRegistry'; - -export interface Spec extends TurboModule { - // Exported methods. - +getConstants: () => {| - const1: boolean, - const2: number, - const3: string, - |}; - +voidFunc: () => void; - +getBool: (arg: boolean) => boolean; - +getNumber: (arg: number) => number; - +getString: (arg: string) => string; - +getArray: (arg: Array) => Array; - +getObject: (arg: Object) => Object; - +getRootTag: (arg: RootTag) => RootTag; - +getValue: (x: number, y: string, z: Object) => Object; - +getValueWithCallback: (callback: (value: string) => void) => void; - +getValueWithPromise: (error: boolean) => Promise; -} - -export default (TurboModuleRegistry.getEnforcing( - 'SampleTurboModule', -): Spec); -`; - -const SAMPLE_TURBO_MODULE_VARIABLE_ASSIGNMENT = ` -// @flow - -import type {RootTag, TurboModule} from '../RCTExport'; -import * as TurboModuleRegistry from '../TurboModuleRegistry'; - -export interface Spec extends TurboModule { - // Exported methods. - +getConstants: () => {| - const1: boolean, - const2: number, - const3: string, - |}; - +voidFunc: () => void; - +getBool: (arg: boolean) => boolean; - +getNumber: (arg: number) => number; - +getString: (arg: string) => string; - +getArray: (arg: Array) => Array; - +getObject: (arg: Object) => Object; - +getRootTag: (arg: RootTag) => RootTag; - +getValue: (x: number, y: string, z: Object) => Object; - +getValueWithCallback: (callback: (value: string) => void) => void; - +getValueWithPromise: (error: boolean) => Promise; -} - -const module = TurboModuleRegistry.getEnforcing( - 'SampleTurboModule', -); - -export default (module: Spec); -`; - module.exports = { 'NotANativeComponent.js': NOT_A_NATIVE_COMPONENT, 'FullNativeComponent.js': FULL_NATIVE_COMPONENT, 'FullTypedNativeComponent.js': FULL_NATIVE_COMPONENT_WITH_TYPE_EXPORT, - 'NativeSampleTurboModule0.js': SAMPLE_TURBO_MODULE_SINGLE_DEFAULT_EXPORT, - 'NativeSampleTurboModule1.js': SAMPLE_TURBO_MODULE_VARIABLE_ASSIGNMENT, }; diff --git a/packages/babel-plugin-codegen/__tests__/__snapshots__/index-test.js.snap b/packages/babel-plugin-codegen/__tests__/__snapshots__/index-test.js.snap index 1da53e5bc14..7018db249d9 100644 --- a/packages/babel-plugin-codegen/__tests__/__snapshots__/index-test.js.snap +++ b/packages/babel-plugin-codegen/__tests__/__snapshots__/index-test.js.snap @@ -124,57 +124,6 @@ export const Commands = { };" `; -exports[`Babel plugin inline view configs can inline config for NativeSampleTurboModule0.js 1`] = ` -"// @flow -import type { RootTag, TurboModule } from '../RCTExport'; -import * as TurboModuleRegistry from '../TurboModuleRegistry'; -export interface Spec extends TurboModule { - // Exported methods. - +getConstants: () => {| - const1: boolean, - const2: number, - const3: string, - |}, - +voidFunc: () => void, - +getBool: (arg: boolean) => boolean, - +getNumber: (arg: number) => number, - +getString: (arg: string) => string, - +getArray: (arg: Array) => Array, - +getObject: (arg: Object) => Object, - +getRootTag: (arg: RootTag) => RootTag, - +getValue: (x: number, y: string, z: Object) => Object, - +getValueWithCallback: (callback: (value: string) => void) => void, - +getValueWithPromise: (error: boolean) => Promise, -} -export default (TurboModuleRegistry.getEnforcing('SampleTurboModule'): Spec);" -`; - -exports[`Babel plugin inline view configs can inline config for NativeSampleTurboModule1.js 1`] = ` -"// @flow -import type { RootTag, TurboModule } from '../RCTExport'; -import * as TurboModuleRegistry from '../TurboModuleRegistry'; -export interface Spec extends TurboModule { - // Exported methods. - +getConstants: () => {| - const1: boolean, - const2: number, - const3: string, - |}, - +voidFunc: () => void, - +getBool: (arg: boolean) => boolean, - +getNumber: (arg: number) => number, - +getString: (arg: string) => string, - +getArray: (arg: Array) => Array, - +getObject: (arg: Object) => Object, - +getRootTag: (arg: RootTag) => RootTag, - +getValue: (x: number, y: string, z: Object) => Object, - +getValueWithCallback: (callback: (value: string) => void) => void, - +getValueWithPromise: (error: boolean) => Promise, -} -const module = TurboModuleRegistry.getEnforcing('SampleTurboModule'); -export default (module: Spec);" -`; - exports[`Babel plugin inline view configs can inline config for NotANativeComponent.js 1`] = ` "const requireNativeComponent = require('requireNativeComponent');