You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I have a setup where I offload some common strategies for testing in a helper file,
I run tests the same as if they were using the regular describe/it pattern: jest x-var.test.ts
I assume neotest-jest, is looking for the describe() and test() methods to register the tests.
Is there a configuration I'm missing or an improvement I can implement to the project that would help neotest-jest infer the tests?
as they function exactly the same but just a bit abstracted for convenience.
importtestRulefrom"./__helpers__/helper";testRule("x-var-truthy",[{name: "pass:x-var is properly defined in OAS3",document: {openapi: "3.0.0",info: {version: "1.0"},paths: {"/": {get: {"x-var": {name: "aabbcc"}}}},},errors: [],},]);
Edit: I've been experimenting with tricking neotest-jest into thinking it's in another describe/test block. But neotest throws errors when nesting describe inside tests.
Note: I'm a bit new to using Typescript and jest in general. So if it simply isn't possible, Could a solution be to synthetically define tests through annotations or comments?
I'd hate to miss out on re-running tests and navigating through the summery buffer. It's amazing.
The text was updated successfully, but these errors were encountered:
SirAppSec
changed the title
Abstrected Jest tests using __helpers__/helper.ts
Abstracted Jest tests using __helpers__/helper.ts
Feb 29, 2024
I have a setup where I offload some common strategies for testing in a helper file,
I run tests the same as if they were using the regular describe/it pattern:
jest x-var.test.ts
I assume neotest-jest, is looking for the describe() and test() methods to register the tests.
Is there a configuration I'm missing or an improvement I can implement to the project that would help neotest-jest infer the tests?
as they function exactly the same but just a bit abstracted for convenience.
helpers/helper.ts:
And a Test file x-var.test.ts:
Edit: I've been experimenting with tricking neotest-jest into thinking it's in another describe/test block. But neotest throws errors when nesting describe inside tests.
Note: I'm a bit new to using Typescript and jest in general. So if it simply isn't possible, Could a solution be to synthetically define tests through annotations or comments?
I'd hate to miss out on re-running tests and navigating through the summery buffer. It's amazing.
The text was updated successfully, but these errors were encountered: