Skip to content

v1.2.0

Latest

Choose a tag to compare

@github-actions github-actions released this 28 Oct 23:24
v1.2.0
31278cb

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",
      }),
    },
  },
});

v1.1.0...v1.2.0

  • docs: add separate files for each feature b76ea63
  • feat(replace): allow nested mocks (#1) fa43f1b