Skip to content

Commit d1a0225

Browse files
ci: fix (#188)
1 parent 990d9f6 commit d1a0225

File tree

2 files changed

+27
-2
lines changed

2 files changed

+27
-2
lines changed

.github/workflows/test.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -47,9 +47,9 @@ jobs:
4747
architecture: ${{ steps.calculate_architecture.outputs.result }}
4848
cache: yarn
4949
- name: Install dependencies
50-
run: yarn --frozen-lockfile
50+
run: yarn --frozen-lockfile --ignore-engines
5151
- name: Run tests with coverage
52-
run: yarn test --ci
52+
run: yarn test --ci --coverage
5353
- uses: codecov/codecov-action@v5
5454
with:
5555
flags: integration

lib/__tests__/Hook.js

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,31 @@ describe("Hook", () => {
6767
hook.call();
6868
expect(calls).toEqual(["E", "F", "C", "D", "B", "A"]);
6969
});
70+
71+
it("should work with `withOptions`", () => {
72+
const hook = new SyncHook();
73+
74+
const calls = [];
75+
76+
hook
77+
.withOptions({
78+
stage: -10
79+
})
80+
.tap("A", () => calls.push("A"));
81+
82+
hook.tap(
83+
{
84+
name: "B",
85+
stage: 0
86+
},
87+
() => calls.push("B")
88+
);
89+
90+
calls.length = 0;
91+
hook.call();
92+
expect(calls).toEqual(["A", "B"]);
93+
});
94+
7095
it("should throw without a valid name", () => {
7196
const hook = new SyncHook();
7297
expect(() => hook.tap("", () => {})).toThrow(

0 commit comments

Comments
 (0)