Skip to content

Commit 0029b7f

Browse files
committed
test(linter/plugins): normalize line breaks in snapshots (#14154)
Trim leading/trailing line breaks from `stdout` in test snapshots and convert `\r\n` to `\n`. This ensures tests will pass on Windows, and removes extraneous line breaks from snapshots.
1 parent 7f2c101 commit 0029b7f

File tree

30 files changed

+11
-36
lines changed

30 files changed

+11
-36
lines changed

apps/oxlint/test/fixtures/basic_custom_plugin/output.snap.md

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@
33

44
# stdout
55
```
6-
76
x basic-custom-plugin(no-debugger): Unexpected Debugger Statement
87
,-[files/index.js:1:1]
98
1 | debugger;

apps/oxlint/test/fixtures/basic_custom_plugin_many_files/output.snap.md

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@
33

44
# stdout
55
```
6-
76
x basic-custom-plugin(no-debugger): Unexpected Debugger Statement
87
,-[files/01.js:1:1]
98
1 | debugger;

apps/oxlint/test/fixtures/basic_custom_plugin_multiple_rules/output.snap.md

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@
33

44
# stdout
55
```
6-
76
x basic-custom-plugin(no-debugger): Unexpected Debugger Statement
87
,-[files/index.js:1:1]
98
1 | debugger;

apps/oxlint/test/fixtures/basic_custom_plugin_warn_severity/output.snap.md

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@
33

44
# stdout
55
```
6-
76
! basic-custom-plugin(no-debugger): Unexpected Debugger Statement
87
,-[files/index.js:1:1]
98
1 | debugger;

apps/oxlint/test/fixtures/built_in_errors/output.snap.md

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@
33

44
# stdout
55
```
6-
76
x ]8;;https://oxc.rs/docs/guide/usage/linter/rules/eslint/no-debugger.html\eslint(no-debugger)]8;;\: `debugger` statement is not allowed
87
,-[files/index.js:1:1]
98
1 | debugger;

apps/oxlint/test/fixtures/context_properties/output.snap.md

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@
33

44
# stdout
55
```
6-
76
x context-plugin(log-context): id: context-plugin/log-context
87
,-[files/1.js:1:1]
98
1 | let x;

apps/oxlint/test/fixtures/createOnce/output.snap.md

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@
33

44
# stdout
55
```
6-
76
x create-once-plugin(after-only): after hook: filename: files/1.js
87
,-[files/1.js:1:1]
98
1 | let x;

apps/oxlint/test/fixtures/custom_plugin_disable_directives/output.snap.md

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@
33

44
# stdout
55
```
6-
76
x test-plugin(no-var): Use let or const instead of var
87
,-[files/index.js:3:1]
98
2 |

apps/oxlint/test/fixtures/custom_plugin_import_error/output.snap.md

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,5 +8,4 @@ Failed to parse configuration file.
88
x Failed to load JS plugin: ./plugin.js
99
| Error: whoops!
1010
| at <root>/apps/oxlint/test/fixtures/custom_plugin_import_error/plugin.js:1:7
11-
1211
```

apps/oxlint/test/fixtures/custom_plugin_lint_after_hook_error/output.snap.md

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@
33

44
# stdout
55
```
6-
76
x Error running JS plugin.
87
| File path: <root>/apps/oxlint/test/fixtures/custom_plugin_lint_after_hook_error/files/index.js
98
| Error: Whoops!

0 commit comments

Comments
 (0)