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: migrate tests to vitest #3381

Open
wants to merge 129 commits into
base: main
Choose a base branch
from
Open

chore: migrate tests to vitest #3381

wants to merge 129 commits into from

Conversation

mattjennings
Copy link
Contributor

@mattjennings mattjennings commented Mar 3, 2025

TODO:

  • migrate jasmine memory usage reporters to vitest

===:clipboard: PR Checklist :clipboard:===

  • 📌 issue exists in github for these changes
  • 🔬 existing tests still pass
  • 🙈 code conforms to the style guide
  • 📐 new tests written and passing / old tests updated with new scenario(s)
  • 📄 changelog entry added (or not needed)

==================

Closes #

Changes:

@mattjennings mattjennings changed the title chore: migrate tests to vite (PoC) chore: migrate tests to vitest (PoC) Mar 3, 2025
@github-actions github-actions bot added the chore Maintenance tasks, like upgrading libraries or release tasks label Mar 3, 2025
Copy link

cloudflare-workers-and-pages bot commented Mar 3, 2025

Deploying excaliburjs with  Cloudflare Pages  Cloudflare Pages

Latest commit: 009c0e7
Status: ✅  Deploy successful!
Preview URL: https://24d375c4.excaliburjs.pages.dev
Branch Preview URL: https://chore-vitest.excaliburjs.pages.dev

View logs

@mattjennings mattjennings marked this pull request as ready for review April 5, 2025 17:57
@mattjennings
Copy link
Contributor Author

mattjennings commented Apr 5, 2025

@eonarheim at long last the tests are passing. let me know what you think of how i handled the TextSpec tests.

Also IIRC this still lacks the memory tracking and other custom karma reporting stuff. would you want that done in this PR?

(oh and we still need to test that the browserstack karma tests still run... seems like the workflow for that only runs on commits to the main branch)

@mattjennings
Copy link
Contributor Author

mattjennings commented Apr 5, 2025

managed to migrate the engine leak & memory reporters, although it took a bit of rigamarole. Mainly because, as opposed to karma, the reporter runs in node and not the browser. So I have to track the data needed separately in some global hooks within the browser environment, which the reporter then reads and creates the logs if needed.

However, it seems the memory tracking is regularly reporting >1 mb, so I'm not sure if it's tracking properly or if things have changed with the new browsers. My only theory is that because the timing where memory is read is during an afterEach before the test's afterEach, it's running before any potential cleanup. The timing of this is not something that's easy to control, unfortunately. I did try to prove this theory by doing the memory analysis on the next test's beforeEach, but it didnt seem to change the results, so it may not be an issue.

Implementation is done in src/spec/vitest/__reporters__/memory.ts and src/spec/vitest/__reporters/memory.setup.ts

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
chore Maintenance tasks, like upgrading libraries or release tasks
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants