Skip to content

Commit

Permalink
Merge fix-test
Browse files Browse the repository at this point in the history
  • Loading branch information
Romakita committed Dec 13, 2021
2 parents 14da2c7 + f6c59f4 commit 5bc7301
Show file tree
Hide file tree
Showing 5 changed files with 18 additions and 12 deletions.
1 change: 1 addition & 0 deletions packages/gphoto2-core/src/utils/GPPointer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import {alloc, allocCString, Pointer, refType} from "ref-napi";
* @returns {Pointer<T>}
*/
export function GPPointer<T = any>(type: any = "void"): Pointer<T> {
console.log(alloc);
return alloc(type) as any;
}

Expand Down
8 changes: 8 additions & 0 deletions packages/gphoto2-driver/src/__mock__/gphoto2-core.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
import {FakeBuffer} from "./FakeBuffer";

export function GPPointer(refType: any, value?: any) {
return new FakeBuffer(refType.name || refType, value);
}

export const GPPointerString = jest.fn();
export const getGPhoto2Driver = jest.fn();
7 changes: 3 additions & 4 deletions packages/gphoto2-driver/src/components/AbilitiesList.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,10 @@ import {$log} from "@tsed/logger";

$log.stop();

jest.mock("@tsed/gphoto2-core");
jest.mock("ref-napi", () => {
jest.mock("@tsed/gphoto2-core", () => {
return {
...jest.requireActual("ref-napi"),
...jest.requireActual("@tsed/gphoto2-driver/src/__mock__/ref-napi")
...jest.requireActual("@tsed/gphoto2-core"),
...jest.requireActual("@tsed/gphoto2-driver/src/__mock__/gphoto2-core")
};
});

Expand Down
7 changes: 3 additions & 4 deletions packages/gphoto2-driver/src/components/CameraList.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,10 @@ import {alloc} from "../__mock__/ref-napi";

$log.stop();

jest.mock("@tsed/gphoto2-core");
jest.mock("ref-napi", () => {
jest.mock("@tsed/gphoto2-core", () => {
return {
...jest.requireActual("ref-napi"),
...jest.requireActual("@tsed/gphoto2-driver/src/__mock__/ref-napi")
...jest.requireActual("@tsed/gphoto2-core"),
...jest.requireActual("@tsed/gphoto2-driver/src/__mock__/gphoto2-core")
};
});

Expand Down
7 changes: 3 additions & 4 deletions packages/gphoto2-driver/src/components/List.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,10 @@ import {alloc} from "../__mock__/ref-napi";

$log.stop();

jest.mock("@tsed/gphoto2-core");
jest.mock("ref-napi", () => {
jest.mock("@tsed/gphoto2-core", () => {
return {
...jest.requireActual("ref-napi"),
...jest.requireActual("@tsed/gphoto2-driver/src/__mock__/ref-napi")
...jest.requireActual("@tsed/gphoto2-core"),
...jest.requireActual("@tsed/gphoto2-driver/src/__mock__/gphoto2-core")
};
});

Expand Down

0 comments on commit 5bc7301

Please sign in to comment.