Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
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
7 changes: 3 additions & 4 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,10 +26,9 @@ jobs:
# create the bundles required for studio-web
# TODO: stop updating the bundle, keep the published one.
npx nx bundle web-component
# Not compatible with Angular 21
#- name: Specs Test
# run: |
# npx nx test:once studio-web
- name: Specs Test
run: |
npx nx test:once studio-web
- name: Build
run: |
npx nx build studio-web --configuration=production
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/dev-preview.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,9 +26,9 @@ jobs:
run: |
# create the bundles required for studio-web
npx nx bundle web-component
#- name: Test
# run: |
# npx nx test:once studio-web
- name: Test
run: |
npx nx test:once studio-web
- name: Build
run: |
sed -r -i 's:readalong-studio.mothertongues.org/:readalong-studio.mothertongues.org/dev/:g' packages/studio-web/src/environments/environment.prod.ts
Expand Down
9 changes: 4 additions & 5 deletions .github/workflows/end-to-end-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -43,11 +43,10 @@ jobs:
wait-on: sleep 15 # there is no reliable URL to wait for...
command: npx nx test:once web-component

# Disabled since not compatible with Angular 21
#- name: Ng spec tests for studio-web
# run: |
# npx nx build web-component
# npx nx test:once studio-web
- name: Ng spec tests for studio-web
run: |
npx nx build web-component
npx nx test:once studio-web

- name: Check that i18n and l10n are up to date
run: |
Expand Down
8 changes: 4 additions & 4 deletions .github/workflows/windows-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,10 @@ jobs:
- run: npm install -g npm@latest
- run: npm ci --verbose
- run: npx update-browserslist-db@latest
#- name: Ng test for studio-web
# run: |
# npx nx build web-component
# npx nx test:once studio-web
- name: Ng test for studio-web
run: |
npx nx build web-component
npx nx test:once studio-web

- name: Cypress run for web-component
uses: cypress-io/github-action@783cb3f07983868532cabaedaa1e6c00ff4786a8 # v7.1.9
Expand Down
22 changes: 19 additions & 3 deletions packages/studio-web/src/test.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,20 @@
// The testing environment is now initialized automatically by Angular, and the tests
// are found automatically, so no need to do much here.

// Angular no longer requires enumerating spec files here; the karma builder
// finds them automatically.
//
// The test environment still needs to be initialized explicitly, though:
// without it, the first NgModule compiled via TestBed silently leaves
// Angular's internal module registry in a broken state (surfaces later as
// `TypeError: Cannot read properties of null (reading 'ngModule')` from
// completely unrelated tests). `@angular/platform-browser-dynamic/testing`
// (the pre-v21 way to do this) no longer exists; this is its replacement.
import "zone.js/testing";
import { getTestBed } from "@angular/core/testing";
import {
BrowserTestingModule,
platformBrowserTesting,
} from "@angular/platform-browser/testing";

getTestBed().initTestEnvironment(
BrowserTestingModule,
platformBrowserTesting(),
);
1 change: 1 addition & 0 deletions packages/studio-web/tsconfig.spec.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
{
"extends": "./tsconfig.json",
"compilerOptions": {
"moduleResolution": "bundler",
"outDir": "./out-tsc/spec",
"types": ["jasmine"]
},
Expand Down
Loading