Skip to content

Commit 43c9d74

Browse files
committed
chore: testing
1 parent dffe847 commit 43c9d74

File tree

5 files changed

+23
-2
lines changed

5 files changed

+23
-2
lines changed

test/controllers/update-controller.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,9 @@ function createTestInjector(projectDir: string = projectFolder): IInjector {
2020
initializeProjectData: () => {
2121
/* empty */
2222
},
23+
getBuildRelativeDirectoryPath: () => {
24+
/* empty */
25+
},
2326
dependencies: {
2427
"@nativescript/core": "next",
2528
},

test/plugins-service.ts

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,7 @@ import {
4949
// import { ProjectConfigService } from "../lib/services/project-config-service";
5050
import { FileSystem } from "../lib/common/file-system";
5151
import { ProjectHelper } from "../lib/common/project-helper";
52+
import { LiveSyncProcessDataService } from "../lib/services/livesync-process-data-service";
5253
// import { basename } from 'path';
5354
temp.track();
5455

@@ -236,6 +237,10 @@ function createTestInjector() {
236237
id: "org.nativescript.Test",
237238
})
238239
);
240+
testInjector.register(
241+
"liveSyncProcessDataService",
242+
LiveSyncProcessDataService
243+
);
239244

240245
return testInjector;
241246
}
@@ -855,6 +860,10 @@ describe("Plugins service", () => {
855860
);
856861
unitTestsInjector.register("nodeModulesDependenciesBuilder", {});
857862
unitTestsInjector.register("tempService", stubs.TempServiceStub);
863+
unitTestsInjector.register(
864+
"liveSyncProcessDataService",
865+
LiveSyncProcessDataService
866+
);
858867
return unitTestsInjector;
859868
};
860869

test/services/android-project-service.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ import {
2020
IProjectDir,
2121
} from "../../lib/common/declarations";
2222
import { PLATFORMS_DIR_NAME } from "../../lib/constants";
23+
import { LiveSyncProcessDataService } from "../../lib/services/livesync-process-data-service";
2324

2425
const createTestInjector = (): IInjector => {
2526
const testInjector = new Yok();
@@ -61,6 +62,8 @@ const createTestInjector = (): IInjector => {
6162
testInjector.register("staticConfig", {
6263
TRACK_FEATURE_USAGE_SETTING_NAME: "TrackFeatureUsage",
6364
});
65+
66+
testInjector.register("liveSyncProcessDataService", LiveSyncProcessDataService);
6467
return testInjector;
6568
};
6669

test/services/android/gradle-build-args-service.ts

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -60,16 +60,19 @@ async function executeTests(
6060
}
6161
const ksPath = temp.path({ prefix: "ksPath" });
6262
const expectedInfoLoggingArgs = ["--quiet"];
63-
const expectedTraceLoggingArgs = ["--stacktrace", "--debug"];
63+
const expectedTraceLoggingArgs = ["--debug"];
6464
const expectedDebugBuildArgs = [
65+
"--stacktrace",
6566
"-PcompileSdk=android-28",
6667
"-PtargetSdk=26",
6768
"-PbuildToolsVersion=my-build-tools-version",
6869
"-PgenerateTypings=true",
69-
"-DprojectRoot=/path/to/projectDir",
7070
"-PprojectRoot=/path/to/projectDir",
71+
"-DprojectRoot=/path/to/projectDir",
7172
"-PappPath=/path/to/projectDir/app".replace(/\//g, path.sep),
7273
"-PappBuildPath=platforms",
74+
"-DappBuildPath=platforms",
75+
"-PappPath=/path/to/projectDir/app",
7376
"-PappResourcesPath=/path/to/projectDir/app/App_Resources".replace(
7477
/\//g,
7578
path.sep

test/stubs.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -698,6 +698,9 @@ export class ProjectDataStub implements IProjectData {
698698
this.projectIdentifiers = { android: "", ios: "" };
699699
this.projectId = "";
700700
this.projectName = "";
701+
this.nsConfig = {
702+
android: {}
703+
};
701704
}
702705

703706
public initializeProjectDataFromContent(): void {

0 commit comments

Comments
 (0)