- 
          
 - 
                Notifications
    
You must be signed in to change notification settings  - Fork 16
 
test: migrate from Karma to Vitest Browser #79
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?
test: migrate from Karma to Vitest Browser #79
Conversation
71734a0    to
    de56129      
    Compare
  
    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.
LGTM
          
 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.  | 
    
| 
           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
  
    
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.