mirror of
https://github.com/status-im/react-native.git
synced 2025-01-09 09:12:02 +00:00
1f498010e8
Summary: This is first PR from the series I am going to be sending as a result of fixing 0.50-stable test suite. This one removes `mockFS` dependency that has been causing failures on Node 6.x container. Here's build before this change: https://circleci.com/gh/facebook/react-native/22529 Here's build after this change: https://circleci.com/gh/facebook/react-native/22538 (green) Note that the CI may be still red as there are other PRs to be addressed. You can see this in the wild on 0.50. Closes https://github.com/facebook/react-native/pull/16301 Differential Revision: D6031352 Pulled By: hramos fbshipit-source-id: 5c97ae6c87864c094e29e5d8987521071c67f5bd
75 lines
1.6 KiB
JavaScript
75 lines
1.6 KiB
JavaScript
const fs = require.requireActual('fs');
|
|
const path = require('path');
|
|
|
|
const manifest = fs.readFileSync(path.join(__dirname, './files/AndroidManifest.xml'));
|
|
const mainJavaClass = fs.readFileSync(path.join(__dirname, './files/Main.java'));
|
|
|
|
function generateValidFileStructure(classFileName) {
|
|
return {
|
|
src: {
|
|
'AndroidManifest.xml': manifest,
|
|
main: {
|
|
com: {
|
|
some: {
|
|
example: {
|
|
'Main.java': mainJavaClass,
|
|
[classFileName]: fs.readFileSync(path.join(__dirname, `./files/${classFileName}`)),
|
|
},
|
|
},
|
|
},
|
|
},
|
|
},
|
|
};
|
|
}
|
|
|
|
exports.valid = generateValidFileStructure('ReactPackage.java');
|
|
|
|
exports.validKotlin = generateValidFileStructure('ReactPackage.kt');
|
|
|
|
exports.userConfigManifest = {
|
|
src: {
|
|
main: {
|
|
'AndroidManifest.xml': manifest,
|
|
com: {
|
|
some: {
|
|
example: {
|
|
'Main.java': mainJavaClass,
|
|
'ReactPackage.java': fs.readFileSync(path.join(__dirname, './files/ReactPackage.java')),
|
|
},
|
|
},
|
|
},
|
|
},
|
|
debug: {
|
|
'AndroidManifest.xml': fs.readFileSync(path.join(__dirname, './files/AndroidManifest-debug.xml')),
|
|
},
|
|
},
|
|
};
|
|
|
|
exports.corrupted = {
|
|
src: {
|
|
'AndroidManifest.xml': manifest,
|
|
main: {
|
|
com: {
|
|
some: {
|
|
example: {},
|
|
},
|
|
},
|
|
},
|
|
},
|
|
};
|
|
|
|
exports.noPackage = {
|
|
src: {
|
|
'AndroidManifest.xml': manifest,
|
|
main: {
|
|
com: {
|
|
some: {
|
|
example: {
|
|
'Main.java': mainJavaClass,
|
|
},
|
|
},
|
|
},
|
|
},
|
|
},
|
|
};
|