Repository navigation
Improvements
tq.replace now accepts nested relative mocks, allowing you to mock modules on a package level:
const { bar, bizz } = await tq.replace<typeof import("./foo.js")({
modulePath: "./foo.js",
importMeta: import.meta,
localMocks: {
"./bar.js": {
// an export of `bar`
bar: tq.spy(),
"./baz.js": tq.mock<typeof import("./baz.js")>({
// an export of `baz`
bizz: "buzz",
}),
},
},
});