You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Vitest throws error when testing an instance of a class that implements a private method. The error occurs because private method's name starts with the # symbol which it is unable to parse.
As of Acorn 8.2.0 private fields and private methods are supported in Acorn without the need to use this (or another) plugin, I recommend upgrading Acorn.
Describe the bug
ℹ️ I've opened a related issue at acornjs as requested: acornjs/acorn-class-fields#17
Vitest throws error when testing an instance of a class that implements a private method. The error occurs because private method's name starts with the
#
symbol which it is unable to parse.The project that I'm trying to add vitest to: twitterjs/twitter.js#96
Reproduction
https://stackblitz.com/edit/node-stkuzb
System Info
Used Package Manager
npm
Logs
FAIL src/client/__tests__/Client.test.ts [ src/client/__tests__/Client.test.ts ] Error: Parse failure: Unexpected token (60:8) Contents of line 60: async #fetchClientUser(username) { ❯ ssrTransform node_modules/vite/dist/node/chunks/dep-fcec4469.js:56614:15 ❯ doTransform node_modules/vite/dist/node/chunks/dep-fcec4469.js:57940:48 ❯ processTicksAndRejections ../../../node:internal/process/task_queues:96:5
Validations
The text was updated successfully, but these errors were encountered: