Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: vitest #3344

Open
wants to merge 15 commits into
base: v6
Choose a base branch
from
Open

chore: vitest #3344

wants to merge 15 commits into from

Conversation

fratzinger
Copy link
Member

@fratzinger fratzinger commented Nov 21, 2023

migrate tests to vitest

  • add vitest to all packages
  • rm mocha & ts-node from all packages
  • change scripts accordingly
  • rename before/after mocha-hooks to beforeAll & afterAll
  • migrate from callbacks (deprecated in vitest) to Promises
  • do not use static ports, use pkg 'get-port' instead

- chore: migrate from callbacks to Promises
- chore: do not use static ports, use pkg 'get-port' instead
Copy link

@noor-tg noor-tg left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Will you also change the building & dev tools to vite ?

For reference, I am using vite & vitest now with feathers .

So if you need any help . I am here

@daffl
Copy link
Member

daffl commented Dec 1, 2023

I'd be open to this if the tests all pass, it run faster and supports a watch mode where it runs a package test suite on code changes.

Personally I was debating of moving everything to the new built-in Node test runner to reduce dependencies and - now that it is stable - also have to worry less about version upgrades (which was finicky sometimes even with Mocha which hasn't really changed much). But it's still clunky to use in some cases. For example, it doesn't support running TypeScript tests recursively (except with a programmatic hack).

@daffl
Copy link
Member

daffl commented Jan 25, 2024

I started using Vitest in another project and it is indeed working quite nicely and was the only test runner that worked with ES modules out of the box so this might also help us with the pains from #3375

Copy link

cloudflare-workers-and-pages bot commented Mar 22, 2024

Deploying feathers-dove with  Cloudflare Pages  Cloudflare Pages

Latest commit: ca2608f
Status: ✅  Deploy successful!
Preview URL: https://b9fc15e1.feathers.pages.dev
Branch Preview URL: https://chore-vitest.feathers.pages.dev

View logs

@fratzinger fratzinger marked this pull request as ready for review March 22, 2024 20:04
@fratzinger
Copy link
Member Author

CI is broken for some reason. Only package that fails is '@feathersjs/knex' I think. But I don't know why. Please @daffl have a look.

@fratzinger fratzinger changed the title WIP: chore: vitest chore: vitest Mar 25, 2024
@daffl daffl changed the base branch from dove to v6 September 25, 2024 20:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants