vscode-jest
vscode-jest copied to clipboard
Spread operator breaks inline errors
This test updates the comment string each time:
it('tests jest', () => {
expect(33).toBe(new Date().getTime()); // Expected value to be (using ===): 1482978207691 Recieved: 33
});
This test doesn't show it at all or doesn't update it after a ES7 spread operator is added.
it('tests jest', () => {
const test = { ...{} };
expect(33).toBe(new Date().getTime());
});
In the dev console it errors with:
workbench.main.js:132 Unexpected token (8:19): SyntaxError: Unexpected token (8:19)
at Parser.pp$5.raise (/home/sam/.vscode/extensions/Orta.vscode-jest-2.0.3/node_modules/jest-editor-support/node_modules/babylon/lib/index.js:4246:13)
Weird. I have JS validation enabled in vscode & am using v1.8.1.
Im guessing the plugin doesn't inherit the projects babel config?
It should be - we pull the nearest babelrc and use that
My babelrc uses stage-1 and my source code uses spreads fine so that's interesting. It may be being overwritten with a different babel instance or perhaps the plugins are being included from the wrong location (dependency mismatches)?
This is kinda odd:
const configFilePath = path.join(directory, BABELRC_FILENAME);
It's referencing a static filename? What if you have .babelrc.json .babelrc.yml. I use .babelrc so this doesn't apply but that looks a bit weak.
I'll have to see whether it is indeed finding it.
This issue has been inactive for over a year and has been marked as stale. It will be automatically closed in 30 days if no further activity occurs. Since significant changes have occurred in the codebase, please open a new issue with updated details if the problem still persists.