Update tests to use the sandyLegacy wrapper by default
Summary: Changed unit test infra to wrap legacy plugins by default in Sandy, and adapted tests where needed. Reviewed By: nikoant Differential Revision: D29264660 fbshipit-source-id: fe7cbc8af826afac5f945103586b3cb9647e7fbd
This commit is contained in:
committed by
Facebook GitHub Bot
parent
00e2c803ef
commit
640e06f130
@@ -318,11 +318,11 @@ const requirePluginInternal = (
|
||||
plugin.packageName = pluginDetails.name;
|
||||
plugin.details = pluginDetails;
|
||||
|
||||
if (GK.get('flipper_use_sandy_plugin_wrapper')) {
|
||||
return new _SandyPluginDefinition(
|
||||
pluginDetails,
|
||||
createSandyPluginWrapper(plugin),
|
||||
);
|
||||
if (
|
||||
GK.get('flipper_use_sandy_plugin_wrapper') ||
|
||||
process.env.NODE_ENV === 'test'
|
||||
) {
|
||||
return createSandyPluginFromClassicPlugin(pluginDetails, plugin);
|
||||
}
|
||||
|
||||
// set values from package.json as static variables on class
|
||||
@@ -336,6 +336,17 @@ const requirePluginInternal = (
|
||||
return plugin;
|
||||
};
|
||||
|
||||
export function createSandyPluginFromClassicPlugin(
|
||||
pluginDetails: ActivatablePluginDetails,
|
||||
plugin: any,
|
||||
) {
|
||||
pluginDetails.id = plugin.id; // for backward compatibility, see above check!
|
||||
return new _SandyPluginDefinition(
|
||||
pluginDetails,
|
||||
createSandyPluginWrapper(plugin),
|
||||
);
|
||||
}
|
||||
|
||||
export function selectCompatibleMarketplaceVersions(
|
||||
availablePlugins: MarketplacePluginDetails[],
|
||||
): MarketplacePluginDetails[] {
|
||||
|
||||
Reference in New Issue
Block a user