re-enable gutter run icons with customizd jest tests

hello,

i have customized tests to skip when certain env vars are enabled as i will show below. this causes my run icons do disappear in the gutter. is there a way to inform webstorm to recognize my custom tags and re-enable the run icons? thx

 

const enableLegacyTests = process.env.enableLegacyTests === 'true';
const describeIf = enableLegacyTests ? describe : describe.skip;

describe('legacy tests env check', () => {
it('check legacy tests run locally', () => {
if (!enableLegacyTests) {
console.log('enabled');
}
expect(true).toBeTruthy();
});
});

describeIf('Session - focused tests', () => {
console.log('test');
});
1 comment
Comment actions Permalink

the IDE is statically analyzing the source code looking for known code patterns when detecting the tests/suits. Obviously, your describeIf() hook is not known, so your tests are not detected and can't be run from the sidebar. There are no workarounds unfortunately.

We have a feature request for providing support for custom test/suite names, https://youtrack.jetbrains.com/issue/WEB-37848, please feel free to vote for it.

0

Please sign in to leave a comment.