Commit Graph

2 Commits

Author SHA1 Message Date
Jean Lauliac 9c242c8a2f react-native-github: set path mock to posix by default
Summary:
@public

Otherwise tests using `path` but not `fs` have an empty mock, as it happens on https://github.com/facebook/metro/issues/235#issuecomment-423722747

Reviewed By: mjesun

Differential Revision: D10008513

fbshipit-source-id: 673e2ca79c8105a68818985dc08fe7ccd5d13881
2018-09-24 06:32:24 -07:00
Jean Lauliac e327f88f02 react-native: make automated fs-based tests platform-independent
Summary:
@public

These tests are using a mock memory FS to start with, so there is no reason at all they should depend on the host OS or filesystem details. This changeset fixes that so that we fully mock the `fs` and `path` modules dependending on the mock platform (not the host platform). I also added an example of how we can test both platforms (regardless of the host platform) in `findPackageClassName`. Follow up changeset will be to do the same for all the other affected tests.

Related to https://github.com/facebook/react-native/issues/20260.

Reviewed By: mjesun

Differential Revision: D9771024

fbshipit-source-id: b368b43e8e54292d33b6183eec9a9ea69f2e6e76
2018-09-17 05:46:47 -07:00