diff --git a/jest/__tests__/hasteImpl-test.js b/jest/__tests__/hasteImpl-test.js index de493aa9a153da..ce2718f41eb1a5 100644 --- a/jest/__tests__/hasteImpl-test.js +++ b/jest/__tests__/hasteImpl-test.js @@ -32,7 +32,7 @@ it('returns the correct haste name for a RN library file', () => { }); it('returns the correct haste name for a file with a platform suffix', () => { - for (const platform of ['android', 'ios', 'native', 'web', 'windows']) { + for (const platform of ['android', 'ios', 'native']) { expect( getHasteName( getPath( diff --git a/jest/hasteImpl.js b/jest/hasteImpl.js index 030beeb9ea611a..f3ea39549f12a3 100644 --- a/jest/hasteImpl.js +++ b/jest/hasteImpl.js @@ -14,8 +14,6 @@ const path = require('path'); const ROOTS = [ path.resolve(__dirname, '..') + path.sep, - path.resolve(__dirname, '../../react-native-windows') + path.sep, - path.resolve(__dirname, '../../react-native-dom') + path.sep, ]; const BLACKLISTED_PATTERNS /*: Array */ = [ @@ -36,8 +34,8 @@ const NAME_REDUCERS /*: Array<[RegExp, string]> */ = [ [/^(?:.*[\\\/])?([a-zA-Z0-9$_.-]+)$/, '$1'], // strip .js/.js.flow suffix [/^(.*)\.js(\.flow)?$/, '$1'], - // strip .android/.ios/.native/.web suffix - [/^(.*)\.(android|ios|native|web|windows|dom)$/, '$1'], + // strip platform suffix + [/^(.*)\.(android|ios|native)$/, '$1'], ]; const haste = { diff --git a/local-cli/core/index.js b/local-cli/core/index.js index 7027706250a4c1..07ec5721b28c12 100644 --- a/local-cli/core/index.js +++ b/local-cli/core/index.js @@ -70,11 +70,14 @@ const defaultConfig = { hasteImplModulePath: require.resolve('../../jest/hasteImpl'), getPlatforms(): Array { - return ['ios', 'android', 'windows', 'web', 'dom']; + // if this is less than three items, AndroidTest stops resolving: + // Error: Unable to resolve module `ProgressBarAndroid` from `/Users/mhargett/workspace/react-native/ReactAndroid/src/androidTest/js/ProgressBarTestModule.js`: Module `ProgressBarAndroid` does not exist in the Haste module map + return ['ios', 'android', 'native', ...Object.keys(pluginPlatforms)]; }, getProvidesModuleNodeModules(): Array { - return ['react-native', 'react-native-windows', 'react-native-dom']; + const platformNames = plugins.platforms.map(platform => platform.split(path.sep)[0]); + return ['react-native', ...platformNames]; }, };