Skip to content

Commit a8931d6

Browse files
committed
Lefthook tests are no longer order dependent
1 parent c804fc7 commit a8931d6

File tree

1 file changed

+6
-11
lines changed

1 file changed

+6
-11
lines changed

packages/knip/test/plugins/lefthook-v1.test.ts

Lines changed: 6 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -27,18 +27,13 @@ skipIfBun(() =>
2727
})
2828
);
2929

30-
// The order of the tests is meaningful!
31-
// The first test will execute in the branch checkout worktree folder, and
32-
// resolve correctly the relative main git folder.
33-
// The second test will reuse the resolved hooks folder from the first test
34-
3530
skipIfBun(() =>
36-
test('Find dependencies with the lefthook v1 in a worktreee branch checkout', async () => {
37-
process.chdir(folderWorktree);
31+
test('Find dependencies with the lefthook v1 plugin', async () => {
32+
process.chdir(folderMain);
3833
const { main } = await import('../../src/index.js');
3934
const { counters } = await main({
4035
...baseArguments,
41-
cwd: folderWorktree,
36+
cwd: folderMain,
4237
});
4338

4439
assert.deepEqual(counters, {
@@ -50,12 +45,12 @@ skipIfBun(() =>
5045
);
5146

5247
skipIfBun(() =>
53-
test('Find dependencies with the lefthook v1 plugin', async () => {
54-
process.chdir(folderMain);
48+
test('Find dependencies with the lefthook v1 in a worktreee branch checkout', async () => {
49+
process.chdir(folderWorktree);
5550
const { main } = await import('../../src/index.js');
5651
const { counters } = await main({
5752
...baseArguments,
58-
cwd: folderMain,
53+
cwd: folderWorktree,
5954
});
6055

6156
assert.deepEqual(counters, {

0 commit comments

Comments
 (0)