test: migrate from Karma to Vitest Browser#79
Draft
LayZeeDK wants to merge 77 commits intongbracket:mainfrom
Draft
test: migrate from Karma to Vitest Browser#79LayZeeDK wants to merge 77 commits intongbracket:mainfrom
LayZeeDK wants to merge 77 commits intongbracket:mainfrom
Conversation
71734a0 to
de56129
Compare
Collaborator
Author
Thanks, but I'm not done yet 😊 I need to figure out how to run tests in SSR mode. Maybe just Vitest without Vitest Browser and server providers. And some cleaning left to do in the Git history. Also, there's a test failing in WebKit. |
Contributor
|
not a problem, didn't see it was in draft until afterwards |
6ed7cf1 to
bc27413
Compare
9f34ac5 to
ddbfb54
Compare
038a1ac to
4813dfa
Compare
4813dfa to
049dfc7
Compare
Prevent SSR tests from failiing in GitHub Actions runners.
This also prevents unit test from failing in Vitest.
We have no end-to-end tests. If we did, we might use Playwright which we use for Vitest Browser unit tests.
It was used for SSR unit tests with Karma.
It was probably only used by `@ngtools/webpack` at this point since we now use ESBuild, Vite and Vitest for building, serving, and testing, respectively.
e38a4e3 to
85fad21
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #80.
Work In Progress
To do
MutationObserverin SSR test/implementation@ngtools/webpackenvfromtests_local_browsersCI jobUse the following command to install Playwright locally.
pnpm exec playwright install --with-depsPlaywright version
Based on the relase date of Angular 19.0, and their browser support strategy, I determined that we need to support the following browser ranges.
We match the smallest supported minor version of a browser to a Playwright version and otherwise use the installed version of Playwright in the CI job.
Update Safari test
The
flexvalue of<div fxFlex>in the following example has changed as of Safari 16.In Safari 15, it is
flex: 1 1 1e-9px;while it isflex: 1 1 0px;in Safari 16, 17, and 18.Safari 15
Safari 16
Safari 17
Safari 18
Tested at https://tburleson-layouts-demos.firebaseapp.com/ using Browserling.
I have updated the unit test assertion that failed in supported Safari versions.
Disable
MutationObserverin SSRMutationObserveris unavailable in Angular SSR because it is unsupported by Domino. DisableMutationObserverinLayoutGapDirectivein SSR.