hydrogen icon indicating copy to clipboard operation
hydrogen copied to clipboard

Switch Hydrogen test runner from Jest to Vitest

Open jplhomer opened this issue 3 years ago • 9 comments

jplhomer avatar Feb 15 '22 14:02 jplhomer

Adding Vitest for hydrogen-ui, so we're on that from the start. As we migrate components over, we can translate the existing Jest tests to Vitest.

frehner avatar Apr 19 '22 21:04 frehner

Hey! I see that all tests in hydrogen-ui package have been migrated to vitest. Should we start converting tests in hydrogen package? Are there any prerequisites or blockers?

mrkldshv avatar Jun 30 '22 23:06 mrkldshv

@mrkldshv I don't think so, just the time and bandwidth to do it.

blittle avatar Jul 01 '22 00:07 blittle

Right, I see. Can I start working on this?

mrkldshv avatar Jul 01 '22 07:07 mrkldshv

@mrkldshv Let's hold off for a little bit - there's still some discussion about the future of the hydrogen-ui package that we need to figure out.

I'll respond in this thread with more details once we have made the decision.

Thanks for your enthusiasm! One thing we could try to figure out now / very soon is if we could set it up in a way to slowly migrate the existing tests from Jest to Vitest in-place.

Maybe what we could do is create new Vitest files with a different extension like .vitest.ts and then configure Vitest to only test files with that extension and tell Jest to ignore tests with that extension.

With the goal being that we don't have to do all the tests as once, and instead migrate them over in smaller chunks. Then when it's done we can rename the .vitest.ts -> .test.ts and remove Jest.

Thoughts? Other ideas?

frehner avatar Jul 01 '22 15:07 frehner

Thanks for reply! I was thinking to start migrating tests gradually, and having separate file extension sounds like a good idea. From what I understand we need to wait for the decision concerning hydrogen-ui package, so I'll be waiting for any updates here.

mrkldshv avatar Jul 01 '22 15:07 mrkldshv

I'll see if it's useful / possible to setup that situation with Vitest in the existing repo, and if so, we can at least get started there and migrate tests, regardless of the outcome about hydrogen-ui.

frehner avatar Jul 01 '22 15:07 frehner

That'd be great! Thanks!

mrkldshv avatar Jul 01 '22 15:07 mrkldshv

To provide an update here, as promised above

Let's hold off for a little bit - there's still some discussion about the future of the hydrogen-ui package that we need to figure out.

I'll respond in this thread with more details once we have made the decision.

We're full-speed ahead on hydrogen-ui now 🙂

frehner avatar Aug 20 '22 23:08 frehner