Skip to content

Commit 55e16aa

Browse files
committed
test: add snap tests for cache disabled with vp pack and vp build
1 parent 5036f44 commit 55e16aa

14 files changed

Lines changed: 105 additions & 0 deletions

File tree

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
{
2+
"name": "vp-build-cache-disabled",
3+
"private": true,
4+
"workspaces": [
5+
"packages/*"
6+
],
7+
"packageManager": "pnpm@10.32.1"
8+
}
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
<!doctype html>
2+
<html>
3+
<body>
4+
<script type="module">
5+
console.log('app');
6+
</script>
7+
</body>
8+
</html>
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
{
2+
"name": "app",
3+
"private": true,
4+
"scripts": {
5+
"build": "vp build"
6+
}
7+
}
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
> vp run app#build # first build
2+
> ls packages/app/dist # should have the build output
3+
assets
4+
index.html
5+
6+
> vp run app#build 2>&1 | grep -c 'cache hit' || echo 'no cache hit' # cache disabled, no cache hit
7+
0
8+
no cache hit
9+
10+
> vp run app#build 2>&1 | grep 'cache disabled' # should show cache disabled
11+
~/packages/app$ vp build ⊘ cache disabled
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
{
2+
"commands": [
3+
{
4+
"command": "vp run app#build # first build",
5+
"ignoreOutput": true
6+
},
7+
"ls packages/app/dist # should have the build output",
8+
"vp run app#build 2>&1 | grep -c 'cache hit' || echo 'no cache hit' # cache disabled, no cache hit",
9+
"vp run app#build 2>&1 | grep 'cache disabled' # should show cache disabled"
10+
]
11+
}
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
export default {
2+
run: {
3+
cache: false,
4+
},
5+
};
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
{
2+
"name": "vp-pack-cache-disabled",
3+
"private": true,
4+
"workspaces": [
5+
"packages/*"
6+
],
7+
"packageManager": "pnpm@10.32.1"
8+
}
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
{
2+
"name": "hello",
3+
"version": "1.0.0",
4+
"type": "module",
5+
"main": "src/index.ts",
6+
"scripts": {
7+
"build": "vp pack"
8+
}
9+
}
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
export function hello() {
2+
console.log('Hello tsdown!');
3+
}
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
import { hello } from './hello.ts';
2+
3+
hello();

0 commit comments

Comments
 (0)