mirror of
https://github.com/pezkuwichain/pezkuwi-dev.git
synced 2026-11-04 23:31:06 +00:00
Fix TypeScript type definitions for test suite
- Add explicit Describe and It interfaces with todo support - Fix mock type compatibility in jest.ts - Update import assertions to import attributes (assert -> with) - Add dynamic.d.mts declaration file - Fix spec files to use explicit type declarations
This commit is contained in:
1 parent
cb6801a3cc
commit
b65f265e87
9 files changed
+2987
-2672
No files matched your search
Vendored
+2
-2
@@ -58,11 +58,11 @@ function extendMock <F extends AnyFn> (mocked: WithMock<F>) {
|
||||
export function jest () {
|
||||
return {
|
||||
jest: enhanceObj(enhanceObj({
|
||||
fn: <F extends AnyFn> (fn?: F) => extendMock<F>(mock.fn(fn)),
|
||||
fn: <F extends AnyFn> (fn?: F) => extendMock<F>(mock.fn(fn) as unknown as WithMock<F>),
|
||||
restoreAllMocks: () => {
|
||||
mock.reset();
|
||||
},
|
||||
spyOn: <F extends AnyFn> (obj: object, key: string) => extendMock<F>(mock.method(obj, key as keyof typeof obj))
|
||||
spyOn: <F extends AnyFn> (obj: object, key: string) => extendMock<F>(mock.method(obj, key as keyof typeof obj) as unknown as WithMock<F>)
|
||||
}, jestWarn), jestStub)
|
||||
};
|
||||
}
|
||||
Reference in new issue
Block a user