test(categories): improve typings in wrapWithThen mock implementation
This commit is contained in:
@@ -20,11 +20,11 @@ describe("CategoriesRepository", () => {
|
|||||||
execute: jest.fn(),
|
execute: jest.fn(),
|
||||||
};
|
};
|
||||||
|
|
||||||
const wrapWithThen = (obj: any) => {
|
const wrapWithThen = (obj: unknown) => {
|
||||||
// biome-ignore lint/suspicious/noThenProperty: Necessary to mock Drizzle's awaitable query builder
|
// biome-ignore lint/suspicious/noThenProperty: Necessary to mock Drizzle's awaitable query builder
|
||||||
Object.defineProperty(obj, "then", {
|
Object.defineProperty(obj, "then", {
|
||||||
value: function (onFulfilled: any) {
|
value: function (onFulfilled: (arg0: unknown) => void) {
|
||||||
const result = this.execute();
|
const result = (this as any).execute();
|
||||||
return Promise.resolve(result).then(onFulfilled);
|
return Promise.resolve(result).then(onFulfilled);
|
||||||
},
|
},
|
||||||
configurable: true,
|
configurable: true,
|
||||||
|
|||||||
Reference in New Issue
Block a user