Files
Mike Grabowski 5f7dba3d6e feat: extract iOS and Android specific linking files out of the core (#290)
Summary:
---------

Historically, Android and iOS platform were hardcoded inside CLI and provided by default. Then, other packages could export additional platforms on top of it.

React Native as a platform was hardcoded in Metro configuration (default platforms, default extensions) and inside link. That means all new features were always developed with these platforms in mind, leaving others behind. We often used private APIs, which made things more complicated for 3rd party platform developers.

From this PR on, there's no longer concept of an out-of-tree platform inside of the CLI. In a follow up PR to React Native, I am going to configure iOS and Android platforms inside React Native, just like React Native Windows exposes Windows platform.

This will open room for improvements and should make it even easier for the CLI to welcome other platforms.
2019-04-05 22:02:26 +02:00

21 lines
391 B
JavaScript

/**
* Copyright (c) Facebook, Inc. and its affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*
* @format
*/
const mockPath = {};
function reset(platform) {
Object.assign(mockPath, jest.requireActual('path')[platform]);
}
mockPath.mock = {reset};
reset('posix');
module.exports = mockPath;