Skip to content

Commit efa3553

Browse files
committed
chore: fix tests
1 parent 02299c8 commit efa3553

File tree

7 files changed

+38
-23
lines changed

7 files changed

+38
-23
lines changed

lib/common/test/unit-tests/mobile/device-log-provider.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@ const createTestInjector = (): IInjector => {
3636
env: {
3737
classicLogs: true,
3838
},
39+
hostProjectModuleName: "app",
3940
});
4041
testInjector.register("loggingLevels", LoggingLevels);
4142
testInjector.register("devicePlatformsConstants", DevicePlatformsConstants);

lib/common/test/unit-tests/services/files-hash-service.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ function createTestInjector(): IInjector {
2222
injector.register("fs", FileSystemStub);
2323
injector.register("logger", LoggerStub);
2424
injector.register("filesHashService", FilesHashService);
25+
injector.register("options", {});
2526

2627
return injector;
2728
}
@@ -74,8 +75,7 @@ describe("filesHashService", () => {
7475
expectedChanges: { file7: "hash7" },
7576
},
7677
{
77-
name:
78-
"should return changes when a file is added and a file is removed from oldHashes",
78+
name: "should return changes when a file is added and a file is removed from oldHashes",
7979
newHashes: addFileHashes({ file9: "hash9" }),
8080
oldHashes: removeFileHashes({ file1: "hash1" }),
8181
expectedChanges: { file1: "hash1", file9: "hash9" },

package-lock.json

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

test/project-files-provider.ts

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,10 @@ function createTestInjector(): IInjector {
3333
},
3434
});
3535

36-
testInjector.register("options", { release: false });
36+
testInjector.register("options", {
37+
release: false,
38+
hostProjectModuleName: "app",
39+
});
3740

3841
return testInjector;
3942
}
@@ -48,7 +51,8 @@ describe("project-files-provider", () => {
4851
projectData = testInjector.resolve("projectData");
4952
projectData.projectDir = projectDir;
5053
projectData.appDirectoryPath = projectData.getAppDirectoryPath();
51-
projectData.appResourcesDirectoryPath = projectData.getAppResourcesDirectoryPath();
54+
projectData.appResourcesDirectoryPath =
55+
projectData.getAppResourcesDirectoryPath();
5256
projectFilesProvider = testInjector.resolve(ProjectFilesProvider);
5357
});
5458

test/services/android-project-service.ts

Lines changed: 13 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,9 @@ const createTestInjector = (): IInjector => {
4141
testInjector.register("androidPluginBuildService", {});
4242
testInjector.register("errors", stubs.ErrorsStub);
4343
testInjector.register("logger", stubs.LoggerStub);
44-
testInjector.register("options", {});
44+
testInjector.register("options", {
45+
hostProjectModuleName: "app",
46+
});
4547
testInjector.register("projectData", stubs.ProjectDataStub);
4648
testInjector.register("androidToolsInfo", {
4749
getToolsInfo: () => {
@@ -240,9 +242,8 @@ describe("androidProjectService", () => {
240242

241243
compileSdkVersion = 29;
242244

243-
const androidToolsInfo = injector.resolve<IAndroidToolsInfo>(
244-
"androidToolsInfo"
245-
);
245+
const androidToolsInfo =
246+
injector.resolve<IAndroidToolsInfo>("androidToolsInfo");
246247
androidToolsInfo.getToolsInfo = (
247248
config?: IProjectDir
248249
): IAndroidToolsInfoData => {
@@ -258,9 +259,10 @@ describe("androidProjectService", () => {
258259
"src"
259260
);
260261
beforeEach(() => {
261-
const androidResourcesMigrationService = injector.resolve<
262-
IAndroidResourcesMigrationService
263-
>("androidResourcesMigrationService");
262+
const androidResourcesMigrationService =
263+
injector.resolve<IAndroidResourcesMigrationService>(
264+
"androidResourcesMigrationService"
265+
);
264266
androidResourcesMigrationService.hasMigrated = () => true;
265267
});
266268

@@ -329,9 +331,10 @@ describe("androidProjectService", () => {
329331

330332
describe("when old Android App_Resources structure is detected (post {N} 4.0 structure)", () => {
331333
beforeEach(() => {
332-
const androidResourcesMigrationService = injector.resolve<
333-
IAndroidResourcesMigrationService
334-
>("androidResourcesMigrationService");
334+
const androidResourcesMigrationService =
335+
injector.resolve<IAndroidResourcesMigrationService>(
336+
"androidResourcesMigrationService"
337+
);
335338
androidResourcesMigrationService.hasMigrated = () => false;
336339
});
337340

test/services/log-source-map-service.ts

Lines changed: 11 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,9 @@ function createTestInjector(): IInjector {
5050
testInjector.register("devicePlatformsConstants", DevicePlatformsConstants);
5151
testInjector.register("logger", LoggerStub);
5252
testInjector.register("logSourceMapService", LogSourceMapService);
53+
testInjector.register("options", {
54+
hostProjectModuleName: "app",
55+
});
5356

5457
return testInjector;
5558
}
@@ -58,12 +61,14 @@ function toPlatformSep(filePath: string) {
5861
return stringReplaceAll(filePath, "/", path.sep);
5962
}
6063

61-
const testCases: IDictionary<Array<{
62-
caseName: string;
63-
message: string;
64-
expected: string;
65-
runtimeVersion?: string;
66-
}>> = {
64+
const testCases: IDictionary<
65+
Array<{
66+
caseName: string;
67+
message: string;
68+
expected: string;
69+
runtimeVersion?: string;
70+
}>
71+
> = {
6772
android: [
6873
{
6974
caseName: "trace message",

test/stubs.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1470,7 +1470,9 @@ export class InjectorStub extends Yok implements IInjector {
14701470
this.register("androidToolsInfo", AndroidToolsInfoStub);
14711471
this.register("logger", LoggerStub);
14721472
this.register("errors", ErrorsStub);
1473-
this.register("options", {});
1473+
this.register("options", {
1474+
hostProjectModuleName: "app",
1475+
});
14741476
this.register("config", {});
14751477
this.register("staticConfig", {});
14761478
this.register("hooksService", HooksServiceStub);

0 commit comments

Comments
 (0)