From 25228d0cc3c730266e2f7ea981f1c0f23dd49384 Mon Sep 17 00:00:00 2001 From: Kristiyan Kostadinov Date: Wed, 9 Sep 2026 17:22:08 +0200 Subject: [PATCH] test: fix failing boundary test Fixes a test that's breaking CI. --- .../compiler-cli/test/ngtsc/boundary_spec.ts | 95 ------------------- .../core/test/render3/error_boundary_spec.ts | 2 +- pnpm-lock.yaml | 19 ---- 3 files changed, 1 insertion(+), 115 deletions(-) diff --git a/packages/compiler-cli/test/ngtsc/boundary_spec.ts b/packages/compiler-cli/test/ngtsc/boundary_spec.ts index 7b329e7d398..3b31abd3def 100644 --- a/packages/compiler-cli/test/ngtsc/boundary_spec.ts +++ b/packages/compiler-cli/test/ngtsc/boundary_spec.ts @@ -264,100 +264,5 @@ runInEachFileSystem(() => { const diags = env.driveDiagnostics(); expect(diags.length).toBe(0); }); - - it('should error when accessing error alias outside of error block', () => { - env.write( - 'test.ts', - ` - import {Component} from '@angular/core'; - - @Component({ - selector: 'test-cmp', - template: \` - @boundary { -
Normal {{ err.message }}
- } @error (let err) { -
{{ err.message }}
- } - \`, - }) - export class TestCmp {} - `, - ); - - const diags = env.driveDiagnostics(); - expect(diags.length).toBe(1); - expect(diags[0].messageText).toContain("Property 'err' does not exist on type 'TestCmp'"); - }); - - it('should correctly handle nested boundary blocks and shadow error alias', () => { - env.write( - 'test.ts', - ` - import {Component} from '@angular/core'; - - class CustomError extends Error { - customField = 'test'; - } - - @Component({ - selector: 'test-cmp', - template: \` - @boundary { - @boundary { -
Inner
- } @error (let err; when err instanceof CustomError) { -
Inner Custom: {{ err.customField }}
- } @error (let err) { -
Inner Fallback: {{ err.message }}
- } - } @error (let err) { -
Outer Fallback: {{ err.message }}
- } - \`, - }) - export class TestCmp { - CustomError = CustomError; - } - `, - ); - - const diags = env.driveDiagnostics(); - expect(diags.length).toBe(0); - }); - - it('should allow multiple error blocks with different conditions', () => { - env.write( - 'test.ts', - ` - import {Component} from '@angular/core'; - - class ErrorA extends Error { type = 'a' } - class ErrorB extends Error { type = 'b' } - - @Component({ - selector: 'test-cmp', - template: \` - @boundary { -
Normal
- } @error (let err; when err instanceof ErrorA) { -
A: {{ err.type }}
- } @error (let err; when err instanceof ErrorB) { -
B: {{ err.type }}
- } @error (let err) { -
Generic: {{ err.message }}
- } - \`, - }) - export class TestCmp { - ErrorA = ErrorA; - ErrorB = ErrorB; - } - `, - ); - - const diags = env.driveDiagnostics(); - expect(diags.length).toBe(0); - }); }); }); diff --git a/packages/core/test/render3/error_boundary_spec.ts b/packages/core/test/render3/error_boundary_spec.ts index b5ae77d9862..8ea9e7c7368 100644 --- a/packages/core/test/render3/error_boundary_spec.ts +++ b/packages/core/test/render3/error_boundary_spec.ts @@ -1063,6 +1063,6 @@ describe('@boundary runtime instructions (JIT)', () => { expect(capturedDetails.declarationType).toBe(Throwing); expect(capturedDetails.boundary).toBeDefined(); expect(capturedDetails.boundary!.type).toBe(Host); - expect(typeof capturedDetails.boundary!.retry).toBe('function'); + expect(typeof capturedDetails.boundary!.reset).toBe('function'); }); }); diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 4c0924a6f5c..a0305124105 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -6,9 +6,6 @@ importers: .: configDependencies: {} packageManagerDependencies: - '@pnpm/exe': - specifier: 12.3.4 - version: 12.3.4 pnpm: specifier: 12.3.4 version: 12.3.4 @@ -59,11 +56,6 @@ packages: cpu: [x64] os: [win32] - '@pnpm/exe@12.3.4': - resolution: {integrity: sha512-Rq7JokWAyYF9IFfn8zofB/q2AgnZlmoMuH5fMHB2+Ta61I9aD7sNm+woZpx6iH+5vb38chdSoYRvOtSqlH72YQ==} - engines: {node: '>=18.*'} - hasBin: true - pnpm@12.3.4: resolution: {integrity: sha512-lhqkH7B32joEpEHZ+OFevAyW2o73ELLrZ7+e58sGEOq9SPH9hfUc/+c4RnhfoPh8VqOocqHYk/hEZ0G1zORUVw==} engines: {node: '>=18.*'} @@ -95,17 +87,6 @@ snapshots: '@pnpm/exe.win32-x64@12.3.4': optional: true - '@pnpm/exe@12.3.4': - optionalDependencies: - '@pnpm/exe.darwin-arm64': 12.3.4 - '@pnpm/exe.darwin-x64': 12.3.4 - '@pnpm/exe.linux-arm64': 12.3.4 - '@pnpm/exe.linux-arm64-musl': 12.3.4 - '@pnpm/exe.linux-x64': 12.3.4 - '@pnpm/exe.linux-x64-musl': 12.3.4 - '@pnpm/exe.win32-arm64': 12.3.4 - '@pnpm/exe.win32-x64': 12.3.4 - pnpm@12.3.4: optionalDependencies: '@pnpm/exe.darwin-arm64': 12.3.4