Skip to content

Commit

Permalink
Bump code coverage
Browse files Browse the repository at this point in the history
  • Loading branch information
hansott committed Feb 27, 2024
1 parent 6f0ad88 commit f06c022
Showing 1 changed file with 17 additions and 0 deletions.
17 changes: 17 additions & 0 deletions library/src/agent/wrap.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,14 @@ import { Hooks } from "./Wrapper";
t.test("it ignores if package is not installed", async (t) => {
const hooks = new Hooks();
hooks.package("unknown").withVersion("^1.0.0");

t.same(wrap(hooks), {});
});

t.test("it ignores if packages have empty selectors", async (t) => {
const hooks = new Hooks();
hooks.package("shimmer").withVersion("^1.0.0");

t.same(wrap(hooks), {});
});

Expand All @@ -21,10 +23,25 @@ t.test("it ignores unknown selectors", async (t) => {
.withVersion("^1.0.0")
.subject((exports) => exports.doesNotExist)
.method("method", () => {});

t.same(wrap(hooks), {
shimmer: {
version: "1.2.1",
supported: true,
},
});

// Force require to load shimmer
require("shimmer");
});

t.test("it ignores if version is not supported", async (t) => {
const hooks = new Hooks();
hooks
.package("shimmer")
.withVersion("^2.0.0")
.subject((exports) => exports)
.method("method", () => {});

t.same(wrap(hooks), {});
});

0 comments on commit f06c022

Please sign in to comment.