Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
77 commits
Select commit Hold shift + click to select a range
22daf69
chore: install Vitest Angular unit test dependencies
LayZeeDK Feb 27, 2025
94c08e4
chore(git): ignore Vitest artifacts
LayZeeDK Feb 27, 2025
78826ee
chore(nx): support Vitest in named inputs
LayZeeDK Feb 27, 2025
8610354
chore: confiugre Vitest workspace
LayZeeDK Feb 27, 2025
e670d8a
chore(flex-layout): use Vitest
LayZeeDK Feb 27, 2025
aad0db2
chore(flex-layout): add solution-style TypeScript configuration
LayZeeDK Feb 27, 2025
8ce93c1
chore: install `@testing-library/jest-dom` 6.6
LayZeeDK Feb 28, 2025
e00da63
test(flex-layout): add Jest DOM matchers
LayZeeDK Feb 28, 2025
c857a63
test(flex-layout): disable custom matchers
LayZeeDK Feb 28, 2025
88e8990
test(flex-layout): migrate Jasmine `spyOn` to `vi.spyOn`
LayZeeDK Feb 28, 2025
389bf19
test: use Vitest `expect` for test utilities
LayZeeDK Feb 28, 2025
84a6db8
chore: update to Vitest 2.1, install `@vitest/browser`, and `playwrig…
LayZeeDK Mar 5, 2025
af12979
test(flex-layout): add `@vitest/browser` types
LayZeeDK Feb 28, 2025
dc8e017
test(flex-layout): configure `@vitest/browser`
LayZeeDK Feb 28, 2025
7929dee
chore: add `test:watch` task
LayZeeDK Mar 5, 2025
96e5cb1
ci(github): install Playwright browsers in `tests_local_browsers` job
LayZeeDK Mar 5, 2025
33078e1
ci(github): run Playwright browsers in parallel jobs
LayZeeDK Mar 5, 2025
f5c2a42
test(flex-layout): replace `toHaveAttributes` assertions with `toHave…
LayZeeDK Mar 5, 2025
d1be750
test(flex-layout): replace `toHaveCssClass` assertions with `toHaveCl…
LayZeeDK Mar 5, 2025
7d8eb47
test(flex-layout): replace `toHaveMap` assertions with `toStrictEqual`
LayZeeDK Mar 5, 2025
ef3c631
test(flex-layout): remove unused custom matchers
LayZeeDK Mar 5, 2025
2ef5a89
test(flex-layout): migrate custom matchers to Vitest
LayZeeDK Mar 6, 2025
f37331d
test(flex-layout): convert SSR test setup to Vitest
LayZeeDK Mar 8, 2025
15cd528
test(flex-layout): correct column layout assertion for modern Safari …
LayZeeDK Mar 12, 2025
94e52b1
ci(github): match Angular 19 browser support
LayZeeDK Mar 15, 2025
acc4f56
chore: add `playwright:install` task
LayZeeDK Mar 15, 2025
bc72440
ci(github): set 10 minutes timeout for browser tests
LayZeeDK Mar 15, 2025
0a87dde
[WIP] ci(gitlab): use latest Firefox
LayZeeDK Mar 15, 2025
6cf0939
ci(github): use retry action
LayZeeDK Mar 15, 2025
e203b2b
[WIP] chore(pnpm): resolve hanging Firefox CI job runs
LayZeeDK Mar 15, 2025
d1dd74c
ci(github): use Playwright container image for browser tests
LayZeeDK Mar 15, 2025
9c06d2d
ci(github): correct Playwright install command, disable `pnpm install…
LayZeeDK Mar 15, 2025
6587787
chore(pnpm): resolve `less` peer dependency for `@angular/build`
LayZeeDK Mar 15, 2025
5e2f388
ci(github): install default dependencies before Playwright
LayZeeDK Mar 15, 2025
8f66783
chore(vitest): run tests in random order in CI
LayZeeDK Mar 15, 2025
45043a8
Revert "[WIP] chore(pnpm): resolve hanging Firefox CI job runs"
LayZeeDK Mar 15, 2025
55168a4
ci(vitest): disable test isolation in CI
LayZeeDK Mar 15, 2025
c7792c5
test: remove `vitest` imports as they might conflict with `@analogjs/…
LayZeeDK Mar 15, 2025
10a92af
chore(vitest): use forks pool in CI
LayZeeDK Mar 15, 2025
0b68bbc
chore(vitest): lower timeout settings in CI
LayZeeDK Mar 15, 2025
06f025d
chore(vitest): use seed that worked for latest Firefox browser tests
LayZeeDK Mar 15, 2025
6127531
chore(vitest): use `list` hooks option
LayZeeDK Mar 15, 2025
e9dd47e
chore(vitest): use `stack` hooks option
LayZeeDK Mar 15, 2025
95fd9a7
ci(vitest): run tests in random order
LayZeeDK Mar 15, 2025
0ce663d
ci(github): allow 10 retries for browser tests
LayZeeDK Mar 17, 2025
d426dbd
refactor(core): remove barrel files
LayZeeDK Mar 17, 2025
b7ff5a0
refactor(core): use relative imports within module boundary
LayZeeDK Mar 17, 2025
382cc0d
refactor(extended): use relative imports within module boundary
LayZeeDK Mar 17, 2025
de12d66
refactor(flex): use relative imports within module boundary
LayZeeDK Mar 17, 2025
a779bf0
refactor(grid): use relative imports within module boundary
LayZeeDK Mar 17, 2025
1105a9c
test(flex): remove deprecated `providedIn` Angular module API
LayZeeDK Mar 17, 2025
f498f68
ci: don't run browser tests in parallel
LayZeeDK Mar 17, 2025
9da21e9
chore: ignore `.vite` directories
LayZeeDK Mar 17, 2025
48cdffd
ci(github): cache Vitest cache outside of `node_modules`
LayZeeDK Mar 17, 2025
7589c90
chore: update `vite` to 5.4.15
LayZeeDK Mar 27, 2025
b174de9
test(vitest): don't run tests in random order
LayZeeDK Mar 28, 2025
5567991
ci: reset Vitest timeouts
LayZeeDK Mar 28, 2025
be64698
ci: limit SSR test concurrency
LayZeeDK Mar 28, 2025
c9860cf
test: correct Vitest cache path
LayZeeDK Mar 28, 2025
03efb89
ci(github): prevent multiple jobs from caching the Vitest cache using…
LayZeeDK Mar 28, 2025
085d3b8
ci(github): correct pnpm lockfile name in hash key
LayZeeDK Mar 28, 2025
6c7b219
ci: use unique Vitest cache key to always save the cache
LayZeeDK Mar 28, 2025
7962da4
ci(github): optimize Vitest cache restoration
LayZeeDK Mar 28, 2025
d2569db
ci(github): increase timeout for browser tests
LayZeeDK Mar 28, 2025
dfc3a74
ci(github): remove retry action
LayZeeDK Apr 12, 2025
c4558bc
ci(github): remove Karma/CircleCI environment variables
LayZeeDK Apr 12, 2025
2a63815
test(demo-app): use Vitest Browser for unit tests
LayZeeDK Apr 12, 2025
b61b091
test(universal-demo-app): use Vitest/Vitest Browser for unit tests
LayZeeDK Apr 12, 2025
f627ca9
refactor(updated-demo): use package imports to respect module boundaries
LayZeeDK Apr 12, 2025
dacd703
test(updated-demo): use Vitest for unit tests
LayZeeDK Apr 12, 2025
3ec07c1
test(updated-demo): resolve test errors
LayZeeDK Apr 12, 2025
0a7bd12
ci: remove CircleCI Karma configurations
LayZeeDK Apr 12, 2025
0ca60c9
chore: remove Karma and Jasmine
LayZeeDK Apr 12, 2025
5edacdb
chore: remove Protractor
LayZeeDK Apr 12, 2025
855aac7
chore: remove `@ngtools/webpack`
LayZeeDK Apr 12, 2025
46fbfe8
chore: remove Webpack
LayZeeDK Apr 12, 2025
85fad21
ci(github): run browser and SSR unit tests for all projects
LayZeeDK Apr 12, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
72 changes: 59 additions & 13 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -65,8 +65,39 @@ jobs:
run: pnpm lint

tests_local_browsers:
runs-on: ubuntu-latest
runs-on: ${{ matrix.playwright-version == '1.37.1' && 'ubuntu-22.04' || 'ubuntu-latest' }} # Ubuntu 24.04 fails when trying to install the libasound2 package, a Playwright system dependency
needs: build
strategy:
fail-fast: false
matrix:
browser:
- chromium
- firefox
- webkit
browser-version:
- latest
playwright-version:
- 1.51.0 # Latest/same as in `package.json`
include:
# Match Angular browser support when Angular 19 was released
- browser: chromium
browser-version: 130 # Previous major Chrome version when Angular 19 was released
playwright-version: 1.48.2
- browser: firefox
browser-version: 130 # Firefox 131 was the previous major version when Angular 19 was released but this is not supported by any Playwright version
playwright-version: 1.48.2
- browser: firefox
browser-version: esr-115 # Old ESR when Firefox 131 was released
playwright-version: 1.37.1
- browser: firefox
browser-version: esr-128 # New ESR when Firefox 131 was released
playwright-version: 1.46.1
- browser: webkit
browser-version: 16 # Previous major Safari version when Angular 19 was released
playwright-version: 1.45.3
container:
image: mcr.microsoft.com/playwright:v${{ matrix.playwright-version }}
options: --user 1001
steps:
- name: Checkout code
uses: actions/checkout@v4
Expand All @@ -80,25 +111,31 @@ jobs:
with:
node-version: 20
cache: pnpm
- name: Cache Vitest cache
uses: actions/cache@v4
with:
path: .vite
key: vitest-browser-${{ runner.os }}-${{ matrix.browser }}-${{ matrix.browser-version }}-configuration-${{ hashFiles('vitest.workspace.ts', '**/vite.config.mts', '**/test-setup.ts') }}-tests-${{ hashFiles('**/**.spec.ts') }}-${{ github.run_id }}
restore-keys: |
vitest-browser-${{ runner.os }}-${{ matrix.browser }}-${{ matrix.browser-version }}-configuration-${{ hashFiles('vitest.workspace.ts', '**/vite.config.mts', '**/test-setup.ts') }}-tests-${{ hashFiles('**/**.spec.ts') }}
vitest-browser-${{ runner.os }}-${{ matrix.browser }}-${{ matrix.browser-version }}-configuration-${{ hashFiles('vitest.workspace.ts', '**/vite.config.mts', '**/test-setup.ts') }}
vitest-browser-${{ runner.os }}-${{ matrix.browser }}-${{ matrix.browser-version }}
vitest-browser-${{ runner.os }}-${{ matrix.browser }}
- name: Download package
uses: actions/download-artifact@v4
with:
name: package
path: dist/releases
- name: Install Chrome
uses: browser-actions/setup-chrome@v1
- name: Install Firefox
uses: browser-actions/setup-firefox@v1
- name: Install dependencies
run: pnpm install
- name: Install Playwright (${{ matrix.playwright-version }})
run: pnpm add --save-dev playwright@${{ matrix.playwright-version }}
# - name: Install Playwright system dependencies
# run: pnpm exec playwright install-deps ${{ matrix.browser }}
# - name: Install Playwright browser (${{ matrix.browser }} ${{ matrix.browser-version }})
# run: pnpm exec playwright install ${{ matrix.browser }}
- name: Run local browser tests
env:
TEST_PLATFORM: local
CIRCLECI: true
CIRCLE_NODE_INDEX: 0
CIRCLE_NODE_TOTAL: 1
KARMA_PARALLEL_BROWSERS: 1
run: pnpm run test
run: pnpm exec nx run-many --targets=test --parallel=1 --browser=${{ matrix.browser }}

tests_ssr:
runs-on: ubuntu-latest
Expand All @@ -116,6 +153,15 @@ jobs:
with:
node-version: 20
cache: pnpm
- name: Cache Vitest cache
uses: actions/cache@v4
with:
path: .vite
key: vitest-ssr-${{ runner.os }}-configuration-${{ hashFiles('vitest.workspace.ts', '**/vite.config.ssr.mts', '**/test-setup.ssr.ts') }}-tests-${{ hashFiles('**/**.spec.ts') }}-${{ github.run_id }}
restore-keys: |
vitest-ssr-${{ runner.os }}-configuration-${{ hashFiles('vitest.workspace.ts', '**/vite.config.ssr.mts', '**/test-setup.ssr.ts') }}-tests-${{ hashFiles('**/**.spec.ts') }}
vitest-ssr-${{ runner.os }}-configuration-${{ hashFiles('vitest.workspace.ts', '**/vite.config.ssr.mts', '**/test-setup.ssr.ts') }}
vitest-ssr-${{ runner.os }}
- name: Download package
uses: actions/download-artifact@v4
with:
Expand All @@ -124,7 +170,7 @@ jobs:
- name: Install dependencies
run: pnpm install
- name: Run SSR tests
run: pnpm test:ssr
run: pnpm exec nx run-many --projects="@ngbracket/ngx-layout" --projects=universal-demo-app --targets=test --parallel=1 --configuration=ssr

integration_tests:
runs-on: ubuntu-latest
Expand Down
4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -43,3 +43,7 @@ out-tsc
.nx/cache
.nx/workspace-data
.angular

vite.config.*.timestamp*
vitest.config.*.timestamp*
.vite
3 changes: 2 additions & 1 deletion .prettierignore
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,5 @@
*.yml
*.md
*.js
*.json
*.json
.vite
5 changes: 3 additions & 2 deletions nx.json
Original file line number Diff line number Diff line change
Expand Up @@ -31,10 +31,11 @@
"production": [
"default",
"!{projectRoot}/tsconfig.spec.json",
"!{projectRoot}/**/*.spec.[jt]s",
"!{projectRoot}/**/?(*.)+(spec|test).[jt]s?(x)?(.snap)",
"!{projectRoot}/karma.conf.js",
"!{projectRoot}/src/test.[jt]s",
"!{projectRoot}/test.[jt]s"
"!{projectRoot}/test.[jt]s",
"!{projectRoot}/(src/)?test-setup.[jt]s"
]
},
"generators": {
Expand Down
50 changes: 19 additions & 31 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,8 @@
"build:universal-demo-app": "nx run universal-demo-app:build:production",
"serve:universal-demo-app": "nx run universal-demo-app:serve-ssr",
"test": "nx test @ngbracket/ngx-layout",
"test:ssr": "webpack --config test/webpack-spec-ssr-bundle.js && jasmine --config=test/jasmine-ssr.json",
"test:ssr": "nx test @ngbracket/ngx-layout --configuration=ssr",
"test:watch": "vitest --watch --ui --project \"@ngbracket/ngx-layout\"",
"lint": "stylelint projects/libs/**/*.scss --config=stylelint-config.json && tslint --project ./tsconfig.json --config tslint.json",
"release": "pnpm build && pnpm stamp",
"changelog": "conventional-changelog -p angular -i CHANGELOG.md -s",
Expand All @@ -35,7 +36,8 @@
"update": "nx migrate latest",
"dep-graph": "nx dep-graph",
"help": "nx help",
"nx": "nx"
"nx": "nx",
"playwright:install": "playwright install --with-deps"
},
"private": true,
"requiredAngularVersion": ">=19.0.0",
Expand All @@ -57,6 +59,9 @@
"zone.js": "^0.15.0"
},
"devDependencies": {
"@analogjs/vite-plugin-angular": "~1.10.0",
"@analogjs/vitest-angular": "~1.10.0",
"@angular-devkit/architect": "~0.1900.0",
"@angular-devkit/build-angular": "19.1.7",
"@angular-devkit/core": "19.1.7",
"@angular-devkit/schematics": "19.1.7",
Expand All @@ -65,68 +70,51 @@
"@angular/compiler-cli": "19.1.6",
"@eslint/js": "^9.20.0",
"@angular/language-service": "19.1.6",
"@ngtools/webpack": "^19.1.7",
"@nx/angular": "20.4.4",
"@nx/eslint": "20.4.4",
"@nx/eslint-plugin": "20.4.4",
"@nx/js": "20.4.4",
"@nx/vite": "20.4.4",
"@nx/web": "20.4.4",
"@nx/workspace": "20.4.4",
"@schematics/angular": "19.1.7",
"@swc-node/register": "~1.9.2",
"@swc/core": "~1.5.29",
"@swc/helpers": "~0.5.15",
"@testing-library/jest-dom": "6.6.3",
"@types/express": "^4.17.21",
"@types/jasmine": "^5.1.6",
"@types/minimatch": "^5.1.2",
"@types/node": "^20.17.19",
"@typescript-eslint/utils": "^8.24.0",
"@vitest/browser": "^2.1.9",
"@vitest/coverage-v8": "^2.1.9",
"@vitest/ui": "^2.1.9",
"angular-eslint": "^19.1.0",
"autoprefixer": "^10.4.0",
"conventional-changelog-cli": "^4.1.0",
"eslint": "^9.20.1",
"eslint-config-prettier": "^9.1.0",
"jasmine": "^5.6.0",
"jasmine-core": "^5.6.0",
"karma": "^6.4.4",
"karma-browserstack-launcher": "^1.6.0",
"karma-chrome-launcher": "^3.2.0",
"karma-coverage": "^2.2.1",
"karma-firefox-launcher": "^2.1.3",
"karma-jasmine": "^5.1.0",
"karma-jasmine-html-reporter": "^2.1.0",
"karma-parallel": "^0.3.1",
"karma-sauce-launcher": "^4.3.6",
"jsdom": "~22.1.0",
"minimatch": "^9.0.5",
"ng-packagr": "19.1.2",
"nx": "20.4.4",
"playwright": "1.51.0",
"postcss": "^8.5.2",
"postcss-scss": "^4.0.9",
"prettier": "^3.4.2",
"postcss-url": "~10.1.3",
"protractor": "^7.0.0",
"prettier": "^3.4.2",
"stylelint": "^15.11.0",
"ts-node": "^10.9.2",
"tslint": "^6.1.3",
"tsutils": "^3.21.0",
"typescript": "^5.7.3",
"typescript-eslint": "^8.24.0",
"webpack": "^5.98.0",
"webpack-cli": "^5.1.4"
},
"pnpm": {
"onlyBuiltDependencies": [
"@parcel/watcher",
"core-js",
"esbuild",
"lmdb",
"msgpackr-extract",
"nx",
"puppeteer"
]
"vite": "^5.4.15",
"vitest": "^2.1.9"
},
"resolutions": {
"browser-sync-client": "2.29.3"
"browser-sync-client": "2.29.3",
"less": "^4.2.0"
},
"volta": {
"node": "20.18.1"
Expand Down
Loading
Loading