Replies: 1 comment 1 reply
-
Dynamic Module Re-ImportI'm trying to re-import the vi.mock("./../src/index", () => ({
getOrCreateUniqueMessage: vi
.fn()
.mockImplementation(
async (
db: NodePgDatabase<Record<string, never>>,
data: { content: string }[]
) => {
return Promise.resolve(uniqueMessages);
}
),
createMessageFeed: vi
.fn()
.mockImplementation(
async (
db: NodePgDatabase<Record<string, never>>,
data: { [key: string]: any }[]
) => {
return Promise.resolve([]);
}
),
}));
it("should insert valid messages into the database", async () => {
const { getOrCreateUniqueMessage, createMessageFeed } = await import(
"./../src/index"
);
await SELF.scheduled();
expect(getOrCreateUniqueMessage).toHaveBeenCalledOnce();
}); The I'll keep looking into it. |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Let's review the (proposed) best practice below and brainstorm ways to implement it effectively in our spec files:
At a minimum, these high-level interfaces must:
index.tsfile generated bywall-e.Attempts so far
I wrote this spec file in this PR. The issue with this approach is that the exported functions can't be reused in the
index.tsfile generated bywall-e. It would need to decouple these functions from theindex.tsfile and move them into a separate file.@1712n/dni-nlp-backend
Beta Was this translation helpful? Give feedback.
All reactions