-
Notifications
You must be signed in to change notification settings - Fork 3
Migrate header tests to Vitest browser mode #159
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
base: main
Are you sure you want to change the base?
Conversation
spwoodcock
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Much nicer, good work 👍
Could you provide a minimal reproducible setup for have the relevant chromium / playwright dependencies installed?
I feel like the easiest way to set this up would actually be using chromium / playwright inside docker, for a consistent environment
|
Thank you . Sure, I can put that together. I don’t have a lot of experience with Docker yet, but I’ll figure it out and set up the minimal reproducible environment so the Chromium / Playwright setup is fully consistent. I’ll update the PR once it’s ready. |
|
Or feel free to write up how you set up your environment manually & I can reproduce it using docker for you 😃 Either is fine for me! |
|
That would be helpfull , thank you . Here’s the setup I’m using locally to run Vitest in browser mode with Chromium: Environment
|
|
Hey @Raghavcr7 I will have some time in perhaps a few weeks or few days to look at adding the docker config - uncertain based on what comes up. For now, we most need a way to run these tests in an automated way via CI workflow. Playwright has some good docs on how to do this - would appreciate you taking a stab before I look into it 🙏 |
|
@spwoodcock I will take a look at the documentation and see how to implement the CI workflow. |
|
The workflow is good! If you also make it run on PR too, then we can probably see if it works within this PR before merging 😃 |
|
Oh my bad, I didn't see the workflow run on mobile. On desktop: https://github.com/hotosm/ui/actions/runs/19851789898/job/56913692079?pr=159 Between the repo checkout and the node env install, you need to add something like: - name: Install pnpm
uses: pnpm/action-setup@v4
with:
version: 10 |
|
I have made the changes. Waiting for approval to see if it works. Meanwhile trying to look for a way to test github actions locally so that i can test without waiting. |
|
You can use What I have started doing is removing github action entirely, replacing them with a single Justfile command from a configured task runner - the same locally and in CI |
|
Yeah, I realised it's not that easy or efficient 😅 |
I’ve now migrated the header tests to Vitest 4 Browser Mode with Playwright and removed the old JSDOM polyfills.
All tests pass in Chromium, and the setupTests file is reduced to the minimal browser-mode version.
Ref: #150