mirror of
https://github.com/facebook/react-native.git
synced 2025-11-01 09:14:26 +00:00
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
This commit is contained in:
committed by
Facebook GitHub Bot
parent
80a10953f9
commit
daefa526ad
@@ -103,72 +103,8 @@ export default (codegenNativeComponent<ModuleProps>('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<any>) => Array<any>;
|
||||
+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<string>;
|
||||
}
|
||||
|
||||
export default (TurboModuleRegistry.getEnforcing<Spec>(
|
||||
'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<any>) => Array<any>;
|
||||
+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<string>;
|
||||
}
|
||||
|
||||
const module = TurboModuleRegistry.getEnforcing<Spec>(
|
||||
'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,
|
||||
};
|
||||
|
||||
@@ -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<any>) => Array<any>,
|
||||
+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<string>,
|
||||
}
|
||||
export default (TurboModuleRegistry.getEnforcing<Spec>('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<any>) => Array<any>,
|
||||
+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<string>,
|
||||
}
|
||||
const module = TurboModuleRegistry.getEnforcing<Spec>('SampleTurboModule');
|
||||
export default (module: Spec);"
|
||||
`;
|
||||
|
||||
exports[`Babel plugin inline view configs can inline config for NotANativeComponent.js 1`] = `
|
||||
"const requireNativeComponent = require('requireNativeComponent');
|
||||
|
||||
|
||||
Reference in New Issue
Block a user