Skip to content

Commit f22993f

Browse files
committed
chore: fix unit tests
1 parent 4815f19 commit f22993f

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
@@ -917,6 +917,11 @@ export class AndroidBundleValidatorHelper implements IAndroidBundleValidatorHelp
917917
}
918918
}
919919

920+
export class PerformanceService implements IPerformanceService {
921+
now(): number { return 10; }
922+
processExecutionData() {}
923+
}
924+
920925
export class InjectorStub extends Yok implements IInjector {
921926
constructor() {
922927
super();
@@ -942,5 +947,6 @@ export class InjectorStub extends Yok implements IInjector {
942947
this.register("androidPluginBuildService", AndroidPluginBuildServiceStub);
943948
this.register('projectData', ProjectDataStub);
944949
this.register('packageInstallationManager', PackageInstallationManagerStub);
950+
this.register('packageInstallationManager', PackageInstallationManagerStub);
945951
}
946952
}

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)