-
-
Notifications
You must be signed in to change notification settings - Fork 1.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
/v RegExp flag is not recognized in Vitest #5220
Comments
Interesting, it looks like this is such a new stuff and ecosystem hasn't caught up with it. Probably this needs to reported to upstream somewhere: One relevant issue I found is typescript's lib.d.ts Just in case, here is a quick repro https://stackblitz.com/edit/vitest-dev-vitest-sgd3av?file=test%2Fbasic.test.ts import { test } from 'vitest'
test("repro", () => {
console.log(/fooo/v)
}) Interestingly, syntax highlighting is also not working... I think workaround for now is to use $ node
> console.log(/fooo/v)
/fooo/v
> new RegExp(/fooo/.source, "v")
/fooo/v |
The |
Nice, I didn't know sapphi-red already reported there 👍 |
Describe the bug
When writing a TypeScript (version 5.3.3) library I need a function using RegExp, which has to use the /v flag (trimmed example in test reproduction).
According to MDN docs it should be supported in node 20.0.0+
The function on its own works all right, but when I want to test it with Vitest I receive an error:
Reproduction
In a function use regex with /v flag:
Then test it with Vitest:
System Info
Used Package Manager
npm
Validations
The text was updated successfully, but these errors were encountered: