Open golergka opened 1 year ago
Implicitly asked for is for the extension to (possibly build), resolve, and evaluate code so it could deduce the test name, such that the plugin could give a solid match to jest cli regex pattern. It’s certainly feasible, but introduces (possibly) a lot of complexity, given the build ecosystem of js.
id personally opt to not support it, or, hear a comprehensive/robust proposal from the community that addresses these challenges, especially a solution that works without invoking jest first to resolve test names.
Jest-Runner is based on vscode-jest-editor-support. (Same as vscode-jest). Which is based on the Babel Compiler.
Means it first need to be supported by vscode-jest-editor-support.
I think somewhere between my issues there was someone who tried to add support but failed.
Would parsing with a regex be too complex?
Would parsing with a regex be too complex?
explain more!
what's discussed above is a test name discovered by runtime evaluation of the test runner or node.js
@firsttris do you know of an open issue with vscode-jest-editor-support
to track the (possible) support of this feature?
There's a popular pattern to write Jest tests with
describe(ClassName.name)
instead ofdescribe("ClassName")
, as this allows to (1) automatically update test names when entity (class or function) is renamed and (2) easily find all usages through the codebase. Unfortunately, jest runner doesn't yet support that.