Skip to content

Commit 9c6aff0

Browse files
committed
fix test code
1 parent da9852f commit 9c6aff0

File tree

3 files changed

+5
-14
lines changed

3 files changed

+5
-14
lines changed

code-push-plugin-testing-framework/script/testConfig.js

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,5 +25,4 @@ exports.updatesDirectory = process.env.UPDATE_DIR ? process.env.UPDATE_DIR : DEF
2525
exports.onlyRunCoreTests = TestUtil_1.TestUtil.resolveBooleanVariables(process.env.CORE);
2626
exports.shouldSetup = TestUtil_1.TestUtil.readMochaCommandLineFlag(SETUP_FLAG_NAME);
2727
exports.isExpoApp = TestUtil_1.TestUtil.readMochaCommandLineFlag(EXPO_FLAG_NAME);
28-
exports.restartEmulators = TestUtil_1.TestUtil.resolveBooleanVariables(process.env.CLEAN);
29-
exports.testOldArch = TestUtil_1.TestUtil.resolveBooleanVariables(process.env.TEST_OLD_ARCH);
28+
exports.restartEmulators = TestUtil_1.TestUtil.resolveBooleanVariables(process.env.CLEAN);

code-push-plugin-testing-framework/typings/code-push-plugin-testing-framework.d.ts

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -415,8 +415,6 @@ declare module 'code-push-plugin-testing-framework/script/testConfig' {
415415
export const shouldSetup: boolean;
416416
export const isExpoApp: boolean;
417417
export const restartEmulators: boolean;
418-
export const testOldArch: boolean;
419-
420418
}
421419
declare module 'code-push-plugin-testing-framework/script/testUtil' {
422420
import Q = require("q");

test/test.ts

Lines changed: 4 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,7 @@ class RNAndroid extends Platform.Android implements RNPlatform {
8686
// we use hard-coded deployment key and server url in app.json
8787
return Q.Promise<void>((resolve, reject) => {
8888
TestUtil.replaceString(androidMainActivityPath, "\"main\"", `"${TestConfig.TestAppName}"`);
89-
TestUtil.replaceString(AndroidManifest, "android:allowBackup=\"true\"", "android:allowBackup=\"true\"" + "\n\t" + "android:usesCleartextTraffic=\"true\"");
89+
TestUtil.replaceString(AndroidManifest, "\\${usesCleartextTraffic}", "true");
9090
resolve(null);
9191
});
9292
}
@@ -101,12 +101,6 @@ class RNAndroid extends Platform.Android implements RNPlatform {
101101
"apply plugin: \"com.facebook.react\"",
102102
"apply plugin: \"com.facebook.react\"\napply from: \"" + gradleContent + "\"");
103103

104-
// Disable new architecture
105-
if (TestConfig.testOldArch) {
106-
const gradleProperties = path.join(innerprojectDirectory, "android", "gradle.properties");
107-
TestUtil.replaceString(gradleProperties, "newArchEnabled=true", "newArchEnabled=false");
108-
}
109-
110104
//// Set the app version to 1.0.0 instead of 1.0
111105
// Set the app version to 1.0.0 in android/app/build.gradle
112106
TestUtil.replaceString(buildGradle, "versionName \"1.0\"", "versionName \"1.0.0\"");
@@ -117,7 +111,7 @@ class RNAndroid extends Platform.Android implements RNPlatform {
117111
const string = path.join(innerprojectDirectory, "android", "app", "src", "main", "res", "values", "strings.xml");
118112
TestUtil.replaceString(string, TestUtil.SERVER_URL_PLACEHOLDER, this.getServerUrl());
119113
TestUtil.replaceString(string, TestUtil.ANDROID_KEY_PLACEHOLDER, this.getDefaultDeploymentKey());
120-
TestUtil.replaceString(AndroidManifest, "android:allowBackup=\"false\"", "android:allowBackup=\"false\"" + "\n\t" + "android:usesCleartextTraffic=\"true\"");
114+
TestUtil.replaceString(AndroidManifest, "\\${usesCleartextTraffic}", "true");
121115

122116

123117
return Q<void>(null);
@@ -200,7 +194,7 @@ class RNIOS extends Platform.IOS implements RNPlatform {
200194
} else {
201195
// Install the Podfile
202196
return TestUtil.copyFile(path.join(TestConfig.templatePath, "ios", "Podfile"), podfilePath, true)
203-
.then(() => TestUtil.getProcessOutput(`RCT_NEW_ARCH_ENABLED=${TestConfig.testOldArch ? 0 : 1} pod install`, { cwd: iOSProject }))
197+
.then(() => TestUtil.getProcessOutput(`pod install`, { cwd: iOSProject }))
204198
// Put the IOS deployment key in the Info.plist
205199
.then(TestUtil.replaceString.bind(undefined, infoPlistPath,
206200
"</dict>\n</plist>",
@@ -342,7 +336,7 @@ class RNProjectManager extends ProjectManager {
342336
.then(TestUtil.getProcessOutput.bind(undefined, `npx expo prebuild --clean`, { cwd: path.join(projectDirectory, TestConfig.TestAppName) }))
343337
.then(() => { return null; });
344338
} else {
345-
return TestUtil.getProcessOutput("npx @react-native-community/cli init " + appName + " --version 0.80.1 --install-pods", { cwd: projectDirectory, timeout: 30 * 60 * 1000 })
339+
return TestUtil.getProcessOutput("npx @react-native-community/cli init " + appName + " --version 0.82.1 --install-pods", { cwd: projectDirectory, timeout: 30 * 60 * 1000 })
346340
.then((e) => { console.log(`"npx @react-native-community/cli init ${appName}" success. cwd=${projectDirectory}`); return e; })
347341
.then(this.copyTemplate.bind(this, templatePath, projectDirectory))
348342
.then<void>(TestUtil.getProcessOutput.bind(undefined, TestConfig.thisPluginInstallString, { cwd: path.join(projectDirectory, TestConfig.TestAppName) }))

0 commit comments

Comments
 (0)