-
-
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: show correct line numbers in stack trace when using vi.resetModu…
…les() (#3020)
- Loading branch information
1 parent
d4d0425
commit 3573032
Showing
5 changed files
with
76 additions
and
30 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
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
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,18 @@ | ||
import { assert, describe, expect, it, vi } from 'vitest' | ||
|
||
describe('suite name', () => { | ||
it('foo', () => { | ||
vi.resetModules() | ||
// a comment here | ||
// another comment | ||
// another comment | ||
// another comment | ||
// another comment | ||
// another comment | ||
// this will mess up the stacktrace lines | ||
expect(1 + 1).eq(2) | ||
expect(2 + 1).eq(3) | ||
assert.equal(Math.sqrt(4), 2) | ||
expect(Math.sqrt(4)).toBe(1) | ||
}) | ||
}) |
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