Skip to content

Commit 2e5a7e9

Browse files
committed
chore: fix tests
1 parent be2ee2a commit 2e5a7e9

File tree

2 files changed

+17
-8
lines changed

2 files changed

+17
-8
lines changed

lib/services/ios-project-service.ts

+9-8
Original file line numberDiff line numberDiff line change
@@ -773,6 +773,8 @@ We will now place an empty obsolete compatability white screen LauncScreen.xib f
773773

774774
public async prepareProject(projectData: IProjectData, platformSpecificData: IPlatformSpecificData): Promise<void> {
775775
const projectRoot = path.join(projectData.platformsDir, "ios");
776+
const platformData = this.getPlatformData(projectData);
777+
const resourcesDirectoryPath = projectData.getAppResourcesDirectoryPath();
776778

777779
const provision = platformSpecificData && platformSpecificData.provision;
778780
const teamId = platformSpecificData && platformSpecificData.teamId;
@@ -809,17 +811,16 @@ We will now place an empty obsolete compatability white screen LauncScreen.xib f
809811
_.each(imagesToRemove, image => project.removeResourceFile(path.join(this.getAppResourcesDestinationDirectoryPath(projectData), image)));
810812

811813
this.savePbxProj(project, projectData);
814+
815+
const resourcesNativeCodePath = path.join(
816+
resourcesDirectoryPath,
817+
platformData.normalizedPlatformName,
818+
constants.NATIVE_SOURCE_FOLDER
819+
);
820+
await this.prepareNativeSourceCode(constants.TNS_NATIVE_SOURCE_GROUP_NAME, resourcesNativeCodePath, projectData);
812821
}
813822

814-
const platformData = this.getPlatformData(projectData);
815-
const resourcesDirectoryPath = projectData.getAppResourcesDirectoryPath();
816823
const pbxProjPath = this.getPbxProjPath(projectData);
817-
const resourcesNativeCodePath = path.join(
818-
resourcesDirectoryPath,
819-
platformData.normalizedPlatformName,
820-
constants.NATIVE_SOURCE_FOLDER
821-
);
822-
await this.prepareNativeSourceCode(constants.TNS_NATIVE_SOURCE_GROUP_NAME, resourcesNativeCodePath, projectData);
823824
this.$iOSWatchAppService.removeWatchApp({ pbxProjPath });
824825
const addedWatchApp = await this.$iOSWatchAppService.addWatchAppFromPath({ watchAppFolderPath: path.join(resourcesDirectoryPath, platformData.normalizedPlatformName), projectData, platformData, pbxProjPath });
825826

test/ios-project-service.ts

+8
Original file line numberDiff line numberDiff line change
@@ -159,6 +159,10 @@ function createTestInjector(projectPath: string, projectName: string, xCode?: IX
159159
removeExtensions: () => { /* */ },
160160
addExtensionsFromPath: () => Promise.resolve()
161161
});
162+
testInjector.register("iOSWatchAppService", {
163+
removeWatchApp: () => { /* */ },
164+
addWatchAppFromPath: () => Promise.resolve()
165+
});
162166
return testInjector;
163167
}
164168

@@ -1064,6 +1068,7 @@ describe("iOS Project Service Signing", () => {
10641068
stack.push({ targetName, manualSigning });
10651069
},
10661070
setManualSigningStyleByTargetProductType: () => ({}),
1071+
setManualSigningStyleByTargetProductTypesList: () => ({}),
10671072
setManualSigningStyleByTargetKey: () => ({})
10681073
};
10691074
};
@@ -1085,6 +1090,7 @@ describe("iOS Project Service Signing", () => {
10851090
stack.push({ targetName, manualSigning });
10861091
},
10871092
setManualSigningStyleByTargetProductType: () => ({}),
1093+
setManualSigningStyleByTargetProductTypesList: () => ({}),
10881094
setManualSigningStyleByTargetKey: () => ({})
10891095
};
10901096
};
@@ -1106,6 +1112,7 @@ describe("iOS Project Service Signing", () => {
11061112
stack.push({ targetName, manualSigning });
11071113
},
11081114
setManualSigningStyleByTargetProductType: () => ({}),
1115+
setManualSigningStyleByTargetProductTypesList: () => ({}),
11091116
setManualSigningStyleByTargetKey: () => ({})
11101117
};
11111118
};
@@ -1296,6 +1303,7 @@ describe("buildProject", () => {
12961303
getSigning: () => ({}),
12971304
setAutomaticSigningStyle: () => ({}),
12981305
setAutomaticSigningStyleByTargetProductType: () => ({}),
1306+
setAutomaticSigningStyleByTargetProductTypesList: () => ({}),
12991307
setAutomaticSigningStyleByTargetKey: () => ({}),
13001308
save: () => ({})
13011309
})

0 commit comments

Comments
 (0)