Closed mnlbox closed 3 years ago
if jest finds your test from commandline there should be no difference if this addon executes jest.
@firsttris Thanks for your quick reply. I have this jest.config.js
file in the root of my project and jest can detect my test correctly. But I can't see any RUN | DEBUG
button in my test file:
module.exports = {
'moduleFileExtensions': [ 'js', 'ts', 'json' ],
'roots': [
'<rootDir>/src'
],
'setupFiles': ['reflect-metadata', 'dotenv/config'],
'setupFilesAfterEnv': ['jest-extended'],
'testEnvironment': 'node',
'testRegex': '.*\\.(int-|manual-)?spec\\.ts$',
'transform': {
'^.+\\.ts$': 'ts-jest'
}
}
ah now i got your point.
have you tried the "jestrunner.codeLensSelector" option in the vscode settings?
here we pass this selector: https://github.com/firsttris/vscode-jest-runner/blob/master/src/extension.ts#L36
the pattern is a GlobPattern, just checked the documentation: https://code.visualstudio.com/api/references/vscode-api#GlobPattern
Yeah as I told I set this value for "jestrunner.codeLensSelector" in extention option page but it's still not working:
**/*.{test,spec,int-spec,manual-spec}.{js,jsx,ts,tsx}
So I think maybe the issue is related to this -
character inside int-spec
and manual-spec
maybe I need to scape this character :thinking:
It's intresting, both of my files mached based on above glob pattern but it's not mached with extention :thinking: This is my pattern and tests: https://www.digitalocean.com/community/tools/glob?comments=true&glob=%2A%2A%2F%2A.%7Btest%2Cspec%2Cint-spec%2Cmanual-spec%7D.%7Bjs%2Cjsx%2Cts%2Ctsx%7D&matches=false&tests=src%2Fhello%2FTestResolver.int-spec.ts&tests=%2Fhello%2FTestResolver.manual-spec.ts&tests=%2F%2F%20This%20won%27t%20match%21&tests=%2Ftest%2Fsome%2Fglobs
wired.
there is not much code releated to this. just initialize the codeLensProvider with this globPattern.
the default globPattern seem works: */.{test,spec}.{js,jsx,ts,tsx}
the only thing different seems to be the -
have you tried
*/.{test,spec,*spec}.{js,jsx,ts,tsx}
any success?
Hi @firsttris Sorry for the late response. No, I checked your suggestion and also some other setting but it seems it's not checking my globPattern at all :cry:
Hi and thanks for this awesome extention.
I changed the matching patter of this extention in option page to the bellow value to suppert
int-spec
andmanual-spec
for my integration and manual tests:But it's still not detected files like
TestResolver.int-spec.ts
andTestResolver.manual-spec.ts
Do I missed anything? :thinking: