Open andyindahouse opened 2 years ago
unsure why it is not working for you.
here is the source code: https://github.com/firsttris/vscode-jest-runner/blob/24bb70702e47943d855bee8724286bab9f9317da/src/extension.ts#L65
this is the provided default value: https://github.com/firsttris/vscode-jest-runner/blob/master/package.json#L96
which is working otherwise it would not work at all wouldnt it?
Perhaps related is what I have been observing:
If I use this in my test code:
import testJSON from '../../../test/config.json';
... the 'Run | Debug' codelenses appear in my code.
If I include this import assertion however, which is supported in Node v18:
import testJSON from '../../../test/config.json' assert { type: 'json' };
...the codelenses disappear.
@andyindahouse Is there anything in your actual test which not widely supported yet?
@firsttris I'd like to keep using import assertions, is there something in the configuration of the extension which will allow for this?
Thanks.
@aligg73 probably the babel parser for jest used by the extension (provided by jest-editor-support) is not supporting this feature yet and crashing as a result.
Jest-editor-support has unit tests for various features / plugins. you can check if this feature is already included.
which is working otherwise it would not work at all wouldnt it?
The default value is working "*/.{test,spec}.{js,jsx,ts,tsx}"
Perhaps related is what I have been observing:
If I use this in my test code:
import testJSON from '../../../test/config.json';
... the 'Run | Debug' codelenses appear in my code. If I include this import assertion however, which is supported in Node v18:
import testJSON from '../../../test/config.json' assert { type: 'json' };
...the codelenses disappear. @andyindahouse Is there anything in your actual test which not widely supported yet?@firsttris I'd like to keep using import assertions, is there something in the configuration of the extension which will allow for this?
Thanks.
Nope, there aren't anything unusual. It's a normal test in TS.
Furthermore if I change the name of my test to fit in the default glob format, It works fine.
@firsttris Have you ever tried to change the default case? Does it works for you? 🤔
you can run the extension in development mode (see readme.md)
check if it crashes inside this try-catch
https://github.com/firsttris/vscode-jest-runner/blob/master/src/JestRunnerCodeLensProvider.ts#L58
+1 overriding the default glob pattern only works if I prefix with **/
Hi!
I've modified this setting:
"jestrunner.codeLensSelector": "*/-{test,acceptance-test}.{js,jsx,ts,tsx}"
But I can't see "run jest option" in explore/context:
It looks like default value can't be overwritten