-
-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: indicator position of error message (#3855)
- Loading branch information
Showing
4 changed files
with
57 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,3 @@ | ||
* text=auto eol=lf | ||
|
||
test/reporters/fixtures/indicator-position.test.js eol=crlf |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
/* eslint-disable no-multiple-empty-lines */ | ||
// this file should be in CRLF format | ||
import { expect, test } from 'vitest' | ||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
test('', async () => { | ||
expect(1 + 1).toBe(3) | ||
expect(1 + 1).toBe(2) | ||
expect(2 + 2).toBe(4) | ||
}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
import { readFileSync } from 'node:fs' | ||
import { expect, test } from 'vitest' | ||
import { resolve } from 'pathe' | ||
import { runVitest } from '../../test-utils' | ||
|
||
test('should print correct indicator position', async () => { | ||
const filename = resolve('./fixtures/indicator-position.test.js') | ||
const { stderr } = await runVitest({ root: './fixtures' }, [filename]) | ||
const code = readFileSync(filename, 'utf-8') | ||
|
||
expect(code).toMatch(/\r\n/) | ||
expect(stderr).toBeTruthy() | ||
expect(stderr).toMatchInlineSnapshot(` | ||
"⎯⎯⎯⎯⎯⎯⎯ Failed Tests 1 ⎯⎯⎯⎯⎯⎯⎯ | ||
FAIL indicator-position.test.js > | ||
AssertionError: expected 2 to be 3 // Object.is equality | ||
- Expected | ||
+ Received | ||
- 3 | ||
+ 2 | ||
❯ indicator-position.test.js:12:17 | ||
10| | ||
11| test('', async () => { | ||
12| expect(1 + 1).toBe(3) | ||
| ^ | ||
13| expect(1 + 1).toBe(2) | ||
14| expect(2 + 2).toBe(4) | ||
⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯[1/1]⎯ | ||
" | ||
`) | ||
}) |