Skip to content

Commit 7d636c0

Browse files
committed
chore: fix unit tests
1 parent e72b5fd commit 7d636c0

File tree

3 files changed

+11
-0
lines changed

3 files changed

+11
-0
lines changed

lib/common/test/unit-tests/decorators.ts

+2
Original file line numberDiff line numberDiff line change
@@ -4,13 +4,15 @@ import { assert } from "chai";
44
import { CacheDecoratorsTest } from "./mocks/decorators-cache";
55
import { InvokeBeforeDecoratorsTest } from "./mocks/decorators-invoke-before";
66
import { isPromise } from "../../helpers";
7+
import { PerformanceService } from "../../../../test/stubs";
78

89
describe("decorators", () => {
910
const moduleName = "moduleName", // This is the name of the injected dependency that will be resolved, for example fs, devicesService, etc.
1011
propertyName = "propertyName"; // This is the name of the method/property from the resolved module
1112

1213
beforeEach(() => {
1314
$injector = new Yok();
15+
$injector.register("performanceService", PerformanceService);
1416
});
1517

1618
after(() => {

test/stubs.ts

+6
Original file line numberDiff line numberDiff line change
@@ -914,6 +914,11 @@ export class AndroidBundleValidatorHelper implements IAndroidBundleValidatorHelp
914914
}
915915
}
916916

917+
export class PerformanceService implements IPerformanceService {
918+
now(): number { return 10; }
919+
processExecutionData() {}
920+
}
921+
917922
export class InjectorStub extends Yok implements IInjector {
918923
constructor() {
919924
super();
@@ -939,5 +944,6 @@ export class InjectorStub extends Yok implements IInjector {
939944
this.register("androidPluginBuildService", AndroidPluginBuildServiceStub);
940945
this.register('projectData', ProjectDataStub);
941946
this.register('packageInstallationManager', PackageInstallationManagerStub);
947+
this.register('packageInstallationManager', PackageInstallationManagerStub);
942948
}
943949
}

test/test-bootstrap.ts

+3
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,9 @@ $injector.register("analyticsService", {
2222
}
2323
});
2424

25+
import { PerformanceService } from "./stubs";
26+
$injector.register("performanceService", PerformanceService);
27+
2528
// Converts the js callstack to typescript
2629
import errors = require("../lib/common/errors");
2730
errors.installUncaughtExceptionListener();

0 commit comments

Comments
 (0)