Skip to content

Commit 8b64d59

Browse files
committed
test(snapshot): PTY coverage for app-root resolution
Uses the interactive snapshot harness to cover the TTY-gated branches the old snap tests cannot reach: single-app auto-select (Selected/Tip lines), the multi-candidate listing under a real terminal, and the defaultPackage note, each in both local and global vp flavors.
1 parent 8f73602 commit 8b64d59

25 files changed

Lines changed: 185 additions & 0 deletions

File tree

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
<!doctype html>
2+
<html>
3+
<body>
4+
<h1>web</h1>
5+
</body>
6+
</html>
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
{ "name": "web", "private": true }
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
{ "name": "app-root-auto-select", "private": true, "workspaces": ["apps/*", "packages/*"] }
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
{ "name": "ui", "private": true, "type": "module", "main": "src/index.ts" }
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
export function hello(name: string): string {
2+
return `hello ${name}`;
3+
}
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
[[case]]
2+
name = "auto_select"
3+
vp = ["local", "global"]
4+
comment = """
5+
With exactly one likely-runnable package, a bare app command in an interactive
6+
terminal auto-selects it, prints the Selected/Tip teaching lines, and runs
7+
there (rfcs/cwd-flag.md). This TTY-only branch was untestable in the old
8+
harness.
9+
"""
10+
steps = [["vp", "build"]]
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
# auto_select
2+
3+
With exactly one likely-runnable package, a bare app command in an interactive
4+
terminal auto-selects it, prints the Selected/Tip teaching lines, and runs
5+
there (rfcs/cwd-flag.md). This TTY-only branch was untestable in the old
6+
harness.
7+
8+
## `vp build`
9+
10+
```
11+
VITE+ - The Unified Toolchain for the Web
12+
13+
Selected package: web (apps/web)
14+
Tip: run this directly with `vp -C apps/web build`
15+
vite <version> building client environment for production...
16+
✓ 2 modules transformed.
17+
computing gzip size...
18+
dist/index.html 0.06 kB │ gzip: 0.06 kB
19+
20+
✓ built in <duration>
21+
```
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
# auto_select
2+
3+
With exactly one likely-runnable package, a bare app command in an interactive
4+
terminal auto-selects it, prints the Selected/Tip teaching lines, and runs
5+
there (rfcs/cwd-flag.md). This TTY-only branch was untestable in the old
6+
harness.
7+
8+
## `vp build`
9+
10+
```
11+
Selected package: web (apps/web)
12+
Tip: run this directly with `vp -C apps/web build`
13+
vite <version> building client environment for production...
14+
✓ 2 modules transformed.
15+
computing gzip size...
16+
dist/index.html 0.06 kB │ gzip: 0.06 kB
17+
18+
✓ built in <duration>
19+
```
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
{ "name": "app-root-default-package", "private": true }
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
{ "name": "ui", "private": true, "type": "module", "main": "src/index.ts" }

0 commit comments

Comments
 (0)