perf(utils): optimize parse stack trace regexp
Description
closes #6039
Check https://github.com/userquin/vitest-stacktrace-issue-6039
Please don't delete this checklist! Before submitting the PR, please make sure you do the following:
- [ ] It's really useful if your PR references an issue where it is discussed ahead of time. If the feature is substantial or introduces breaking changes without a discussion, PR might be closed.
- [ ] Ideally, include a test that fails without this PR but passes with it.
- [ ] Please, don't make changes to
pnpm-lock.yamlunless you introduce a new test example.
Tests
- [ ] Run the tests with
pnpm test:ci.
Documentation
- [ ] If you introduce new functionality, document it. You can run documentation with
pnpm run docscommand.
Changesets
- [ ] Changes in changelog are generated from PR name. Please, make sure that it explains your changes in an understandable manner. Please, prefix changeset messages with
feat:,fix:,perf:,docs:, orchore:.
We should add test case from #6039 that timeouts without this fix.
Added a test in the test/browser folder: rn we cannot test the timeout since we need to add PW/WDIO test, and we have only PW/WDIO tests using happy-dom to test the ui.
If you want to test it, change test:browser:* scripts in test/browser/vite.config.mts and run them:
"test:browser:preview": "BROWSER=firefox PROVIDER=preview vitest",
"test:browser:playwright": "BROWSER=firefox PROVIDER=playwright vitest",
"test:browser:webdriverio": "BROWSER=firefox PROVIDER=webdriverio vitest"
For example, running preview provider:
(check test/ui/test folder)
Seems like the current implementation breaks inline snapshots in the browser
Seems like the current implementation breaks inline snapshots in the browser
By "current", I mean this PR. It works fine in main.
@userquin any luck fixing this issue? 🙏 🙏 🙏
https://github.com/vitest-dev/vitest/pull/8531