Skip to content

Commit 0772707

Browse files
committed
test(snapshots): drop the bin-oxlint/oxfmt wrapper cases (runner bin/ gap)
bin-oxlint-wrapper and bin-oxfmt-wrapper run `node ../node_modules/vite-plus/bin/oxlint`, but the PTY runner links only vite-plus's src+dist into the case node_modules, not bin/, so the module is not found and the error's Node-internal line numbers vary by version (fails on CI). Leave them in the legacy tree until the runner links vite-plus/bin/.
1 parent 62922fe commit 0772707

10 files changed

Lines changed: 220 additions & 208 deletions

File tree

crates/vite_cli_snapshots/tests/cli_snapshots/fixtures/bin_oxfmt_wrapper/snapshots.toml

Lines changed: 0 additions & 9 deletions
This file was deleted.

crates/vite_cli_snapshots/tests/cli_snapshots/fixtures/bin_oxfmt_wrapper/snapshots/bin_oxfmt_wrapper.md

Lines changed: 0 additions & 109 deletions
This file was deleted.

crates/vite_cli_snapshots/tests/cli_snapshots/fixtures/bin_oxlint_wrapper/snapshots.toml

Lines changed: 0 additions & 8 deletions
This file was deleted.

crates/vite_cli_snapshots/tests/cli_snapshots/fixtures/bin_oxlint_wrapper/snapshots/bin_oxlint_wrapper.md

Lines changed: 0 additions & 82 deletions
This file was deleted.

crates/vite_cli_snapshots/tests/cli_snapshots/fixtures/bin_oxfmt_wrapper/package.json renamed to packages/cli/snap-tests/bin-oxfmt-wrapper/package.json

File renamed without changes.
Lines changed: 89 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,89 @@
1+
[1]> node ../node_modules/vite-plus/bin/oxfmt # should reject non-LSP usage
2+
This oxfmt wrapper is for IDE extension use only (lsp or stdin mode).
3+
To format your code, run: vp fmt
4+
5+
[1]> node ../node_modules/vite-plus/bin/oxfmt --help # should reject non-LSP usage
6+
This oxfmt wrapper is for IDE extension use only (lsp or stdin mode).
7+
To format your code, run: vp fmt
8+
9+
> node ../node_modules/vite-plus/bin/oxfmt --lsp --help # should allow LSP mode
10+
Usage: [-c=PATH] [PATH]...
11+
12+
Mode Options:
13+
--init Initialize `.oxfmtrc.json` with default values
14+
--migrate=SOURCE Migrate configuration to `.oxfmtrc.json` from specified source
15+
Available sources: prettier, biome
16+
--lsp Start language server protocol (LSP) server
17+
--stdin-filepath=PATH Specify the file name to use to infer which parser to use
18+
19+
Output Options:
20+
--write Format and write files in place (default)
21+
--check Check if files are formatted, also show statistics
22+
--list-different List files that would be changed
23+
24+
Config Options
25+
-c, --config=PATH Path to the configuration file (.json, .jsonc, .ts, .mts, .cts, .js,
26+
.mjs, .cjs)
27+
--disable-nested-config Do not search for configuration files in subdirectories
28+
29+
Ignore Options
30+
--ignore-path=PATH Path to ignore file(s). Can be specified multiple times. If not
31+
specified, .gitignore and .prettierignore in the current directory are
32+
used.
33+
--with-node-modules Format code in node_modules directory (skipped by default)
34+
35+
Runtime Options
36+
--no-error-on-unmatched-pattern Do not exit with error when pattern is unmatched
37+
--threads=INT Number of threads to use. Set to 1 for using only 1 CPU core.
38+
39+
Available positional items:
40+
PATH Single file, path or list of paths. Glob patterns are also supported.
41+
(Be sure to quote them, otherwise your shell may expand them before
42+
passing.) Exclude patterns with `!` prefix like `'!**/fixtures/*.js'`
43+
are also supported. If not provided, current working directory is used.
44+
45+
Available options:
46+
-h, --help Prints help information
47+
-V, --version Prints version information
48+
49+
50+
> node ../node_modules/vite-plus/bin/oxfmt --stdin-filepath=a.ts --help # should allow Stdin mode
51+
Usage: [-c=PATH] [PATH]...
52+
53+
Mode Options:
54+
--init Initialize `.oxfmtrc.json` with default values
55+
--migrate=SOURCE Migrate configuration to `.oxfmtrc.json` from specified source
56+
Available sources: prettier, biome
57+
--lsp Start language server protocol (LSP) server
58+
--stdin-filepath=PATH Specify the file name to use to infer which parser to use
59+
60+
Output Options:
61+
--write Format and write files in place (default)
62+
--check Check if files are formatted, also show statistics
63+
--list-different List files that would be changed
64+
65+
Config Options
66+
-c, --config=PATH Path to the configuration file (.json, .jsonc, .ts, .mts, .cts, .js,
67+
.mjs, .cjs)
68+
--disable-nested-config Do not search for configuration files in subdirectories
69+
70+
Ignore Options
71+
--ignore-path=PATH Path to ignore file(s). Can be specified multiple times. If not
72+
specified, .gitignore and .prettierignore in the current directory are
73+
used.
74+
--with-node-modules Format code in node_modules directory (skipped by default)
75+
76+
Runtime Options
77+
--no-error-on-unmatched-pattern Do not exit with error when pattern is unmatched
78+
--threads=INT Number of threads to use. Set to 1 for using only 1 CPU core.
79+
80+
Available positional items:
81+
PATH Single file, path or list of paths. Glob patterns are also supported.
82+
(Be sure to quote them, otherwise your shell may expand them before
83+
passing.) Exclude patterns with `!` prefix like `'!**/fixtures/*.js'`
84+
are also supported. If not provided, current working directory is used.
85+
86+
Available options:
87+
-h, --help Prints help information
88+
-V, --version Prints version information
89+
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
{
2+
"commands": [
3+
"node ../node_modules/vite-plus/bin/oxfmt # should reject non-LSP usage",
4+
"node ../node_modules/vite-plus/bin/oxfmt --help # should reject non-LSP usage",
5+
"node ../node_modules/vite-plus/bin/oxfmt --lsp --help # should allow LSP mode",
6+
"node ../node_modules/vite-plus/bin/oxfmt --stdin-filepath=a.ts --help # should allow Stdin mode"
7+
]
8+
}

crates/vite_cli_snapshots/tests/cli_snapshots/fixtures/bin_oxlint_wrapper/package.json renamed to packages/cli/snap-tests/bin-oxlint-wrapper/package.json

File renamed without changes.

0 commit comments

Comments
 (0)