Unexpected Token in JSON error when running tests
Describe the bug @testing-library/react: 13.1.1 vitest: 0.12.9
When running any test from the plugin the run fails with "SyntaxError: Unexpected token in JSON at position 52".
From the output It appears that the plugin is trying to write invalid JSON to a file and then read it back
JSON report written to /var/folders/nh/f9txjbr50mg66b89_51z2d2w0000gn/T/vitest-report-eqem9.json
JUNIT report written to /var/folders/nh/f9txjbr50mg66b89_51z2d2w0000gn/T/vitest-report-eqem9.json
Done in 1.09s.
Run test failed
SyntaxError: Unexpected token
in JSON at position 52
This extension will invoke the vitest command to write to the file and then read the result from the file. This behavior will be changed in the near future, to read results directly from vitest --api. It will fix this issue
@zxch3n Great, thank you - any way around it for now or just need to wait for the change?
Does watch mode work for you?
In the CLI yes its fine
You can now use watch mode inside VS Code
Does test running work on pre-release version now?