neotest-jest icon indicating copy to clipboard operation
neotest-jest copied to clipboard

feat: add support for @swc/jest package as a jest provider

Open benjstephenson opened this issue 1 year ago • 1 comments

A new repo I'm working on is using @swc/jest instead of the normal jest package so I was hoping to be able to still use this plugin to run the tests. I'm not too sure on what would be the best way to set up a test though using the files in the specs directory, any hints would be appreciated.

benjstephenson avatar Aug 12 '24 14:08 benjstephenson

I've contributed a bit to this repo so here are my two cents.

There's a describe("is_test_file", ... in init_spec.lua which you can add your tests to. One test called "matches test files with default test patterns" just stubs the call to lib.files.read to return unparsed json corresponding to a fake package.json. You could do the same but replacing the official jest package with @swc/jest. Hope that helps 🙂

MisanthropicBit avatar Jan 08 '25 19:01 MisanthropicBit