analogjs / analog

The fullstack meta-framework for Angular. Powered by Vite and Nitro
https://analogjs.org
MIT License
2.43k stars 224 forks source link

[FEAT]: Add support for bun:test to angular test integrations #1175

Open NateRadebaugh opened 3 weeks ago

NateRadebaugh commented 3 weeks ago

Which scope/s are relevant/related to the feature request?

create-analog

Information

Vitest is great, but bun:test is way faster.

https://bun.sh/docs/cli/test https://bun.sh/docs/test/lifecycle https://x.com/jarredsumner/status/1632545090160975873

Is it feasible for the angular vitest integration to also work in a "bun test" context? I understand that test runner would not use vite under the hood and would likely need some translation step using some setup.ts file.

bun test --preload ./setup.ts

or

[test]
preload = ["./setup.ts"]

Describe any alternatives/workarounds you're currently using

No response

I would be willing to submit a PR to fix this issue

brandonroberts commented 3 weeks ago

We did something similar with an esbuild plugin

https://github.com/analogjs/analog/blob/beta/packages%2Fvite-plugin-angular%2Fesbuild.ts#L5

Maybe that implementation could be adapted for bun