Skip to content

Conversation

@LayZeeDK
Copy link
Collaborator

@LayZeeDK LayZeeDK commented Mar 5, 2025

Closes #80.

Work In Progress

To do

  • Fix hanging Firefox latest tests in GitHub Actions
  • Run MutationObserver in SSR test/implementation
  • Remove Karma, Jasmine, and related dependencies like @ngtools/webpack
  • Remove env from tests_local_browsers CI job
  • Convert demo project tests to Vitest/Vitest Browser

Use the following command to install Playwright locally.

pnpm exec playwright install --with-deps

Playwright 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.

  • Chrome 130 to latest
  • Firefox 131 to latest
  • Firefox ESR 115 and 128
  • Safari 17 to latest

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 flex value of <div fxFlex> in the following example has changed as of Safari 16.

<div fxLayout="column">
  <div fxFlex="20"></div>
  <div fxFlex="60"></div>
  <div fxFlex></div>
</div>

In Safari 15, it is flex: 1 1 1e-9px; while it is flex: 1 1 0px; in Safari 16, 17, and 18.

column-fxflex-safari-15

Safari 15

column-fxflex-safari-16

Safari 16

column-fxflex-safari-17

Safari 17

column-fxflex-safari-18

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 MutationObserver in SSR

MutationObserver is unavailable in Angular SSR because it is unsupported by Domino. Disable MutationObserver in LayoutGapDirective in SSR.

@LayZeeDK LayZeeDK force-pushed the LayZeeDK/test/migrate-from-karma-to-vitest branch 11 times, most recently from 71734a0 to de56129 Compare March 6, 2025 00:55
Copy link
Contributor

@DuncanFaulkner DuncanFaulkner left a comment

Choose a reason for hiding this comment

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

LGTM

@LayZeeDK
Copy link
Collaborator Author

LayZeeDK commented Mar 6, 2025

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.

@DuncanFaulkner
Copy link
Contributor

not a problem, didn't see it was in draft until afterwards

@LayZeeDK LayZeeDK force-pushed the LayZeeDK/test/migrate-from-karma-to-vitest branch 6 times, most recently from 6ed7cf1 to bc27413 Compare March 12, 2025 21:20
@LayZeeDK LayZeeDK force-pushed the LayZeeDK/test/migrate-from-karma-to-vitest branch 2 times, most recently from 9f34ac5 to ddbfb54 Compare March 14, 2025 23:16
@LayZeeDK LayZeeDK had a problem deploying to FLEX_LAYOUT_BUILDS_TOKEN March 14, 2025 23:20 — with GitHub Actions Failure
@LayZeeDK LayZeeDK force-pushed the LayZeeDK/test/migrate-from-karma-to-vitest branch 4 times, most recently from 038a1ac to 4813dfa Compare March 15, 2025 00:39
@LayZeeDK LayZeeDK had a problem deploying to FLEX_LAYOUT_BUILDS_TOKEN March 15, 2025 00:42 — with GitHub Actions Failure
@LayZeeDK LayZeeDK force-pushed the LayZeeDK/test/migrate-from-karma-to-vitest branch from 4813dfa to 049dfc7 Compare March 15, 2025 00:44
@LayZeeDK LayZeeDK had a problem deploying to FLEX_LAYOUT_BUILDS_TOKEN March 15, 2025 00:47 — with GitHub Actions Failure
LayZeeDK added 28 commits April 13, 2025 02:11
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.
@LayZeeDK LayZeeDK force-pushed the LayZeeDK/test/migrate-from-karma-to-vitest branch from e38a4e3 to 85fad21 Compare April 13, 2025 00:12
@LayZeeDK LayZeeDK had a problem deploying to FLEX_LAYOUT_BUILDS_TOKEN April 13, 2025 00:16 — with GitHub Actions Failure
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.

Replace Jasmine and Karma with Vitest and Vitest Browser

2 participants