-
Notifications
You must be signed in to change notification settings - Fork 21
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
Parsing fails upon encountering optional chaining #51
Comments
I see now that this is because this library does not execute In my case, I believe this plugin would fix it, but again, this library does not use any of the plugins that I indicate in |
hmmm... actually the parser should be able to parse the output from all plugins, see here. But it doesn't load the plugin for you, your project will still need to load the particular plugin so it can be transpired correctly for the parser to parse... where did you see the error message? from the output window or developer console? Are you able to run jest in the terminal? Is vscode-jest using the same command (jest.pathToJest) above? If you still have problems, please create a sample repo so we can quickly narrow it down. |
@connectdotz I have installed the two related plugins just to be sure. Neither worked. "@babel/plugin-proposal-optional-chaining": "^7.11.0",
"@babel/plugin-syntax-optional-chaining": "^7.8.3", And in plugins: [
"@babel/plugin-syntax-optional-chaining",
"@babel/plugin-proposal-optional-chaining",
], But still, the problem persists.
All of my tests run fine when I run with the jest command line, either via |
For clarity, I have tried with both plugins individually as well. |
@JonathanWilbur this might sound silly, but you did restart the extension after adding the babel plugin, right? If none worked, please create a sample repo. I am pretty sure the parser is able to parse optional chaining as I have used it in my projects. |
optional chaining and many other typescript language features also cause parsing to fail. For example, I moved this function out of a test file to prevent parsing from failing: export function assert(condition: any): asserts condition {
expect(condition).toBe(true);
} Given the ubiquity of TypeScript (the vscode-jest extension, for example), would be nice for editor support to enable TS support for |
@JonathanWilbur I tried your repo and the test (in [update] |
Upon encountering an optional chaining operator, the parsing fails. I am using this in the Jest VS Code Extension, but I have also tried the other popular Jest VS Code Extension, both of which fail and both of which use this library. Here is an example that you can try yourself:
This parses correctly. In VS Code, I can see the "Run | Debug" floating over the tests.
When you add the question mark (optional chaining operator), it no longer parses correctly.
This does not parse correctly. I cannot see the "Run | Debug" floating over the tests anymore.
The text was updated successfully, but these errors were encountered: