Skip to content

Commit 092f3f4

Browse files
committed
fix: unit-tests
1 parent 82f5c5a commit 092f3f4

15 files changed

+119
-210
lines changed

lib/common/definitions/node-uuid-base.d.ts

Lines changed: 0 additions & 52 deletions
This file was deleted.

lib/common/definitions/node-uuid-cjs.d.ts

Lines changed: 0 additions & 15 deletions
This file was deleted.

lib/common/definitions/node-uuid.d.ts

Lines changed: 0 additions & 43 deletions
This file was deleted.

lib/common/errors.ts

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -51,15 +51,15 @@ async function resolveCallStack(error: Error): Promise<string> {
5151

5252
const mapData = JSON.parse(fs.readFileSync(mapFileName).toString());
5353

54-
return await SourceMapConsumer.with(mapData, mapFileName, (consumer) => {
55-
const sourcePos = consumer.originalPositionFor({ line: line, column: column });
56-
if (sourcePos && sourcePos.source) {
57-
const source = path.join(path.dirname(fileName), sourcePos.source);
58-
return util.format(" at %s (%s:%s:%s)", functionName, source, sourcePos.line, sourcePos.column);
59-
}
60-
61-
return util.format(" at %s (%s:%s:%s)", functionName, fileName, line, column);
62-
});
54+
return await SourceMapConsumer.with(mapData, null, (consumer) => {
55+
const sourcePos = consumer.originalPositionFor({ line: line, column: column });
56+
if (sourcePos && sourcePos.source) {
57+
const source = path.join(path.dirname(fileName), sourcePos.source);
58+
return util.format(" at %s (%s:%s:%s)", functionName, source, sourcePos.line, sourcePos.column);
59+
}
60+
61+
return util.format(" at %s (%s:%s:%s)", functionName, fileName, line, column);
62+
});
6363
}));
6464

6565
let outputMessage = remapped.join("\n");

lib/common/helpers.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import * as uuid from "uuid";
1+
import { v4 as uuidv4 } from "uuid";
22
import * as net from "net";
33
import { platform, EOL } from "os";
44
import { ReadStream } from "tty";
@@ -241,9 +241,9 @@ export function createGUID(useBraces?: boolean) {
241241
useBraces = useBraces === undefined ? true : useBraces;
242242

243243
if (useBraces) {
244-
output = "{" + uuid.v4() + "}";
244+
output = "{" + uuidv4() + "}";
245245
} else {
246-
output = uuid.v4();
246+
output = uuidv4();
247247
}
248248

249249
return output;

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

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ import * as stubs from "../../../../test/stubs";
88
import * as sinon from "sinon";
99
import { PerformanceService } from "../../../services/performance-service";
1010
import { IInjector } from "../../definitions/yok";
11-
import { injector } from "../../yok";
11+
import { injector, setGlobalInjector } from "../../yok";
1212
import * as _ from 'lodash';
1313

1414
describe("decorators", () => {
@@ -25,13 +25,13 @@ describe("decorators", () => {
2525
];
2626

2727
beforeEach(() => {
28-
(<any>global).$injector = new Yok();
28+
setGlobalInjector(new Yok());
2929
injector.register("performanceService", stubs.PerformanceService);
3030
});
3131

3232
after(() => {
33-
// Make sure global $injector is clean for next tests that will be executed.
34-
(<any>global).$injector = new Yok();
33+
// Make sure global injector is clean for next tests that will be executed.
34+
setGlobalInjector(new Yok());
3535
});
3636

3737
describe("exported", () => {

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ const createTestInjector = (): IInjector => {
4747
projectDir: "projectDir"
4848
};
4949
},
50-
getNSValue: (projectDir: string, propertyName: string): any => {
50+
getRuntimePackage: (projectDir: string, platformName: string): any => {
5151
return {
5252
version: runtimeVersion
5353
};

0 commit comments

Comments
 (0)