Skip to content

Commit 871dce8

Browse files
committed
fix: replace cat with test -f and skip command-dlx-npm10 on musl
- Replace cat FILE checks with test ! -f in remaining snap tests: command-init-inline-config-existing, migration-existing-lint-staged-config, migration-eslint-lintstagedrc, create-missing-typecheck - Skip command-dlx-npm10 on musl
1 parent ddb38dc commit 871dce8

9 files changed

Lines changed: 11 additions & 16 deletions

File tree

packages/cli/snap-tests-global/command-dlx-npm10/steps.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
{
2-
"ignoredPlatforms": ["win32"],
2+
"ignoredPlatforms": ["win32", { "os": "linux", "libc": "musl" }],
33
"commands": [
44
"vp dlx --help # should show help message",
55
"vp dlx -s cowsay hello # should run cowsay with npm exec",

packages/cli/snap-tests-global/create-missing-typecheck/snap.txt

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,5 +20,4 @@ export default defineConfig({
2020
lint: { options: { typeAware: true, typeCheck: true } },
2121
});
2222

23-
> cat vite-plus-monorepo/apps/website/vite.config.ts 2>&1 || true # sub-app should NOT have typeAware/typeCheck
24-
cat: vite-plus-monorepo/apps/website/vite.config.ts: No such file or directory
23+
> test ! -f vite-plus-monorepo/apps/website/vite.config.ts # sub-app should NOT have typeAware/typeCheck

packages/cli/snap-tests-global/create-missing-typecheck/steps.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,6 @@
1111
"ignoreOutput": true
1212
},
1313
"cat vite-plus-monorepo/vite.config.ts # check monorepo root vite.config.ts has typeAware and typeCheck",
14-
"cat vite-plus-monorepo/apps/website/vite.config.ts 2>&1 || true # sub-app should NOT have typeAware/typeCheck"
14+
"test ! -f vite-plus-monorepo/apps/website/vite.config.ts # sub-app should NOT have typeAware/typeCheck"
1515
]
1616
}

packages/cli/snap-tests-global/migration-eslint-lintstagedrc/snap.txt

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,8 +26,7 @@ VITE+ - The Unified Toolchain for the Web
2626
}
2727
}
2828

29-
[1]> cat .lintstagedrc.json # check eslint rewritten to vp lint in lintstagedrc
30-
cat: .lintstagedrc.json: No such file or directory
29+
> test ! -f .lintstagedrc.json # check lintstagedrc.json is removed
3130

3231
> cat vite.config.ts # check oxlint config merged into vite.config.ts
3332
import { defineConfig } from 'vite-plus';

packages/cli/snap-tests-global/migration-eslint-lintstagedrc/steps.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
"commands": [
33
"vp migrate --no-interactive # migration should detect eslint and auto-migrate including lintstagedrc",
44
"cat package.json # check eslint removed and scripts rewritten",
5-
"cat .lintstagedrc.json # check eslint rewritten to vp lint in lintstagedrc",
5+
"test ! -f .lintstagedrc.json # check lintstagedrc.json is removed",
66
"cat vite.config.ts # check oxlint config merged into vite.config.ts"
77
]
88
}

packages/cli/snap-tests-global/migration-existing-lint-staged-config/snap.txt

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,8 +26,7 @@ VITE+ - The Unified Toolchain for the Web
2626
}
2727
}
2828

29-
[1]> cat .lintstagedrc.json # check lintstagedrc.json (should be deleted after inlining to vite.config.ts)
30-
cat: .lintstagedrc.json: No such file or directory
29+
> test ! -f .lintstagedrc.json # check lintstagedrc.json (should be deleted after inlining to vite.config.ts)
3130

3231
> cat vite.config.ts # check staged config migrated to vite.config.ts
3332
import { defineConfig } from 'vite-plus';

packages/cli/snap-tests-global/migration-existing-lint-staged-config/steps.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
{ "command": "git init", "ignoreOutput": true },
44
"vp migrate --no-interactive # migration should add prepare script, remove lint-staged from devDeps",
55
"cat package.json # check prepare script added, lint-staged removed from devDeps",
6-
"cat .lintstagedrc.json # check lintstagedrc.json (should be deleted after inlining to vite.config.ts)",
6+
"test ! -f .lintstagedrc.json # check lintstagedrc.json (should be deleted after inlining to vite.config.ts)",
77
"cat vite.config.ts # check staged config migrated to vite.config.ts",
88
"cat .vite-hooks/pre-commit # check pre-commit hook created"
99
]
Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,9 @@
11
> vp lint --init
22
Skipped initialization: 'lint' already exists in 'vite.config.ts'.
33

4-
> cat .oxlintrc.json && exit 1 || true # check .oxlintrc.json is not created
5-
cat: .oxlintrc.json: No such file or directory
4+
> test ! -f .oxlintrc.json # check .oxlintrc.json is not created
65

76
> vp fmt --init
87
Skipped initialization: 'fmt' already exists in 'vite.config.ts'.
98

10-
> cat .oxfmtrc.json && exit 1 || true # check .oxfmtrc.json is not created
11-
cat: .oxfmtrc.json: No such file or directory
9+
> test ! -f .oxfmtrc.json # check .oxfmtrc.json is not created

packages/cli/snap-tests/command-init-inline-config-existing/steps.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,8 @@
44
},
55
"commands": [
66
"vp lint --init",
7-
"cat .oxlintrc.json && exit 1 || true # check .oxlintrc.json is not created",
7+
"test ! -f .oxlintrc.json # check .oxlintrc.json is not created",
88
"vp fmt --init",
9-
"cat .oxfmtrc.json && exit 1 || true # check .oxfmtrc.json is not created"
9+
"test ! -f .oxfmtrc.json # check .oxfmtrc.json is not created"
1010
]
1111
}

0 commit comments

Comments
 (0)