cashscript icon indicating copy to clipboard operation
cashscript copied to clipboard

Move moving automated tests to Vitest

Open mr-zwets opened this issue 1 year ago • 3 comments

Jest isn't the fastest testing framework and we have quite a lot of tests for CahsScript.

Jest also has bad ESM support, so our testing command looks like this

"test": "NODE_OPTIONS='--experimental-vm-modules --no-warnings' jest"

We also still have some .cjs files because of it in the /jest folder

Jest also has a highfootprint, it does have a lot of ecosystem integration but I don't think we use those.

Vitest or AVA or the Deno built-in testing suite all have similar syntax to Jest so should be easy to migrate over to.

CashScript would still have Jest as a DevDependency because of the jestExtensions functionality for the debug tooling... So the main benefits would be in removed complexity & faster tests

mr-zwets avatar Oct 28 '24 09:10 mr-zwets

I would like to work on this issue!

hereje avatar Aug 26 '25 15:08 hereje

Hey @hereje, thank you for your enthusiasm for contributing to this issue! 😄

@mr-zwets had previously started a WIP PR (#233) with a checklist of steps he wanted to include. Did you see this Draft PR and could you give some information on the differences between your approach and his?

rkalis avatar Sep 02 '25 08:09 rkalis

Hey @hereje, thank you for your enthusiasm for contributing to this issue! 😄

@mr-zwets had previously started a WIP PR (#233) with a checklist of steps he wanted to include. Did you see this Draft PR and could you give some information on the differences between your approach and his?

Hello,

I didn't notice that PR.

Mine removes the extra test compilation steps and simplifies the conditional test suites such as packages/cashscript/test/e2e/misc/timelocks.test.ts

hereje avatar Sep 02 '25 18:09 hereje