Skip to content

Commit 655c4eb

Browse files
committed
test(config): verify vp config is idempotent on second run
1 parent f4f9414 commit 655c4eb

2 files changed

Lines changed: 18 additions & 1 deletion

File tree

packages/cli/snap-tests-global/command-config-prepare-auto-hooks/snap.txt

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,3 +15,17 @@ export default defineConfig({
1515
},
1616

1717
});
18+
19+
> vp config # run again to ensure idempotent
20+
> cat .vite-hooks/pre-commit # should remain unchanged
21+
vp staged
22+
23+
> cat vite.config.ts # should remain unchanged
24+
import { defineConfig } from 'vite-plus';
25+
26+
export default defineConfig({
27+
staged: {
28+
"*": "vp check --fix"
29+
},
30+
31+
});

packages/cli/snap-tests-global/command-config-prepare-auto-hooks/steps.json

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,9 @@
77
"vp config # should install hooks automatically without prompting",
88
"git config --local core.hooksPath # should be .vite-hooks/_",
99
"cat .vite-hooks/pre-commit # should have vp staged",
10-
"cat vite.config.ts # should have staged config"
10+
"cat vite.config.ts # should have staged config",
11+
"vp config # run again to ensure idempotent",
12+
"cat .vite-hooks/pre-commit # should remain unchanged",
13+
"cat vite.config.ts # should remain unchanged"
1114
]
1215
}

0 commit comments

Comments
 (0)