Untitled

Anonymous
plain_text
07/16/2024 12:48 PM
756 B
17
Indexable
w testach dostaje błąd na:

jest.mock("@logic/ajax", () => {
    return {
        ...jest.requireActual("@logic/ajax"),
        useAjax: () => {
            return {
                get: getMock,
            };
        },
    };
});


Error: Spread types may only be created from object types.


ale już

jest.mock("@logic/ajax", () => {
    const acutal =jest.requireActual("@logic/ajax"),
    return {
        ...actual,
        useAjax: () => {
            return {
                get: getMock,
            };
        },
    };
});


działa poprawnie, czemu?
Editor is loading...
Leave a Comment