diff --git a/adev/package.json b/adev/package.json index 876a9bcb880..6dbef7086c7 100644 --- a/adev/package.json +++ b/adev/package.json @@ -42,7 +42,7 @@ "@marijn/find-cluster-break": "1.0.2", "@stackblitz/sdk": "1.11.0", "@types/dom-navigation": "1.0.6", - "@types/jasmine": "5.1.15", + "@types/jasmine": "6.0.0", "@types/jsdom": "27.0.0", "@types/node": "24.10.11", "@typescript/vfs": "1.6.2", @@ -55,8 +55,8 @@ "diff": "8.0.3", "emoji-regex": "10.6.0", "fflate": "0.8.2", - "jasmine-core": "5.13.0", "jsdom": "28.0.0", + "jasmine-core": "6.0.0", "karma-chrome-launcher": "3.2.0", "karma-coverage": "2.2.1", "karma-jasmine": "5.1.0", diff --git a/integration/cli-hello-world-ivy-i18n/package.json b/integration/cli-hello-world-ivy-i18n/package.json index 371630908f1..1d66cca4c2f 100644 --- a/integration/cli-hello-world-ivy-i18n/package.json +++ b/integration/cli-hello-world-ivy-i18n/package.json @@ -31,10 +31,10 @@ "@angular/build": "21.1.0-rc.0", "@angular/cli": "21.1.0-rc.0", "@angular/compiler-cli": "link:./in-existing-linked-by-bazel", - "@types/jasmine": "^5.0.0", + "@types/jasmine": "^6.0.0", "@types/jasminewd2": "^2.0.8", "@types/node": "^20.14.8", - "jasmine-core": "5.13.0", + "jasmine-core": "6.0.1", "jasmine-spec-reporter": "~7.0.0", "npm-run-all": "4.1.5", "protractor": "^7.0.0", diff --git a/integration/cli-hello-world-ivy-i18n/pnpm-lock.yaml b/integration/cli-hello-world-ivy-i18n/pnpm-lock.yaml index 56bb12c0006..49b62d58e0f 100644 --- a/integration/cli-hello-world-ivy-i18n/pnpm-lock.yaml +++ b/integration/cli-hello-world-ivy-i18n/pnpm-lock.yaml @@ -52,8 +52,8 @@ importers: specifier: link:./in-existing-linked-by-bazel version: link:in-existing-linked-by-bazel '@types/jasmine': - specifier: ^5.0.0 - version: 5.1.15 + specifier: ^6.0.0 + version: 6.0.0 '@types/jasminewd2': specifier: ^2.0.8 version: 2.0.13 @@ -61,8 +61,8 @@ importers: specifier: ^20.14.8 version: 20.19.31 jasmine-core: - specifier: 5.13.0 - version: 5.13.0 + specifier: 6.0.1 + version: 6.0.1 jasmine-spec-reporter: specifier: ~7.0.0 version: 7.0.0 @@ -1893,8 +1893,8 @@ packages: '@types/http-proxy@1.17.17': resolution: {integrity: sha512-ED6LB+Z1AVylNTu7hdzuBqOgMnvG/ld6wGCG8wFnAzKX5uyW2K3WD52v0gnLCTK/VLpXtKckgWuyScYK6cSPaw==} - '@types/jasmine@5.1.15': - resolution: {integrity: sha512-ZAC8KjmV2MJxbNTrwXFN+HKeajpXQZp6KpPiR6Aa4XvaEnjP6qh23lL/Rqb7AYzlp3h/rcwDrQ7Gg7q28cQTQg==} + '@types/jasmine@6.0.0': + resolution: {integrity: sha512-18lgGsLmEh3VJk9eZ5wAjTISxdqzl6YOwu8UdMpolajN57QOCNbl+AbHUd+Yu9ItrsFdB+c8LSZSGNg8nHaguw==} '@types/jasminewd2@2.0.13': resolution: {integrity: sha512-aJ3wj8tXMpBrzQ5ghIaqMisD8C3FIrcO6sDKHqFbuqAsI7yOxj0fA7MrRCPLZHIVUjERIwsMmGn/vB0UQ9u0Hg==} @@ -3462,8 +3462,8 @@ packages: jasmine-core@2.8.0: resolution: {integrity: sha512-SNkOkS+/jMZvLhuSx1fjhcNWUC/KG6oVyFUGkSBEr9n1axSNduWU8GlI7suaHXr4yxjet6KjrUZxUTE5WzzWwQ==} - jasmine-core@5.13.0: - resolution: {integrity: sha512-vsYjfh7lyqvZX5QgqKc4YH8phs7g96Z8bsdIFNEU3VqXhlHaq+vov/Fgn/sr6MiUczdZkyXRC3TX369Ll4Nzbw==} + jasmine-core@6.0.1: + resolution: {integrity: sha512-gUtzV5ASR0MLBwDNqri4kBsgKNCcRQd9qOlNw/w/deavD0cl3JmWXXfH8JhKM4LTg6LPTt2IOQ4px3YYfgh2Xg==} jasmine-spec-reporter@7.0.0: resolution: {integrity: sha512-OtC7JRasiTcjsaCBPtMO0Tl8glCejM4J4/dNuOJdA8lBjz4PmWjYQ6pzb0uzpBNAWJMDudYuj9OdXJWqM2QTJg==} @@ -4743,6 +4743,7 @@ packages: tar@7.5.7: resolution: {integrity: sha512-fov56fJiRuThVFXD6o6/Q354S7pnWMJIVlDBYijsTNx6jKSE4pvrDTs6lUnmGvNyfJwFQQwWy3owKz1ucIhveQ==} engines: {node: '>=18'} + deprecated: Old versions of tar are not supported, and contain widely publicized security vulnerabilities, which have been fixed in the current version. Please update. Support for old versions may be purchased (at exorbitant rates) by contacting i@izs.me terser-webpack-plugin@5.3.16: resolution: {integrity: sha512-h9oBFCWrq78NyWWVcSwZarJkZ01c2AyGrzs1crmHZO3QUg9D61Wu4NPjBy69n7JqylFF5y+CsUZYmYEIZ3mR+Q==} @@ -7091,11 +7092,11 @@ snapshots: dependencies: '@types/node': 20.19.31 - '@types/jasmine@5.1.15': {} + '@types/jasmine@6.0.0': {} '@types/jasminewd2@2.0.13': dependencies: - '@types/jasmine': 5.1.15 + '@types/jasmine': 6.0.0 '@types/json-schema@7.0.15': {} @@ -8814,7 +8815,7 @@ snapshots: jasmine-core@2.8.0: {} - jasmine-core@5.13.0: {} + jasmine-core@6.0.1: {} jasmine-spec-reporter@7.0.0: dependencies: diff --git a/integration/cli-signal-inputs/package.json b/integration/cli-signal-inputs/package.json index 6ad8fc1bd38..42038706e3d 100644 --- a/integration/cli-signal-inputs/package.json +++ b/integration/cli-signal-inputs/package.json @@ -28,16 +28,16 @@ "@angular-devkit/build-angular": "21.1.0-rc.0", "@angular/cli": "21.1.0-rc.0", "@angular/compiler-cli": "link:./in-existing-linked-by-bazel", - "@types/jasmine": "^5.0.0", + "@types/jasmine": "^6.0.0", "@types/jasminewd2": "^2.0.8", "@types/node": "^20.14.8", - "jasmine-core": "5.13.0", + "jasmine-core": "6.0.0", "jasmine-spec-reporter": "~7.0.0", "karma": "~6.4.0", "karma-chrome-launcher": "^3.1.0", "karma-coverage-istanbul-reporter": "^3.0.3", "karma-jasmine": "^5.0.0", - "karma-jasmine-html-reporter": "^2.1.0", + "karma-jasmine-html-reporter": "^2.2.0", "protractor": "^7.0.0", "ts-node": "^10.9.1", "typescript": "5.9.3" diff --git a/integration/cli-signal-inputs/pnpm-lock.yaml b/integration/cli-signal-inputs/pnpm-lock.yaml index 548f2643495..5704ca51fc8 100644 --- a/integration/cli-signal-inputs/pnpm-lock.yaml +++ b/integration/cli-signal-inputs/pnpm-lock.yaml @@ -49,8 +49,8 @@ importers: specifier: link:./in-existing-linked-by-bazel version: link:in-existing-linked-by-bazel '@types/jasmine': - specifier: ^5.0.0 - version: 5.1.15 + specifier: ^6.0.0 + version: 6.0.0 '@types/jasminewd2': specifier: ^2.0.8 version: 2.0.13 @@ -58,8 +58,8 @@ importers: specifier: ^20.14.8 version: 20.19.31 jasmine-core: - specifier: 5.13.0 - version: 5.13.0 + specifier: 6.0.0 + version: 6.0.0 jasmine-spec-reporter: specifier: ~7.0.0 version: 7.0.0 @@ -76,8 +76,8 @@ importers: specifier: ^5.0.0 version: 5.1.0(karma@6.4.4) karma-jasmine-html-reporter: - specifier: ^2.1.0 - version: 2.2.0(jasmine-core@5.13.0)(karma-jasmine@5.1.0(karma@6.4.4))(karma@6.4.4) + specifier: ^2.2.0 + version: 2.2.0(jasmine-core@6.0.0)(karma-jasmine@5.1.0(karma@6.4.4))(karma@6.4.4) protractor: specifier: ^7.0.0 version: 7.0.0 @@ -1909,8 +1909,8 @@ packages: '@types/http-proxy@1.17.17': resolution: {integrity: sha512-ED6LB+Z1AVylNTu7hdzuBqOgMnvG/ld6wGCG8wFnAzKX5uyW2K3WD52v0gnLCTK/VLpXtKckgWuyScYK6cSPaw==} - '@types/jasmine@5.1.15': - resolution: {integrity: sha512-ZAC8KjmV2MJxbNTrwXFN+HKeajpXQZp6KpPiR6Aa4XvaEnjP6qh23lL/Rqb7AYzlp3h/rcwDrQ7Gg7q28cQTQg==} + '@types/jasmine@6.0.0': + resolution: {integrity: sha512-18lgGsLmEh3VJk9eZ5wAjTISxdqzl6YOwu8UdMpolajN57QOCNbl+AbHUd+Yu9ItrsFdB+c8LSZSGNg8nHaguw==} '@types/jasminewd2@2.0.13': resolution: {integrity: sha512-aJ3wj8tXMpBrzQ5ghIaqMisD8C3FIrcO6sDKHqFbuqAsI7yOxj0fA7MrRCPLZHIVUjERIwsMmGn/vB0UQ9u0Hg==} @@ -3267,8 +3267,8 @@ packages: jasmine-core@4.6.1: resolution: {integrity: sha512-VYz/BjjmC3klLJlLwA4Kw8ytk0zDSmbbDLNs794VnWmkcCB7I9aAL/D48VNQtmITyPvea2C3jdUMfc3kAoy0PQ==} - jasmine-core@5.13.0: - resolution: {integrity: sha512-vsYjfh7lyqvZX5QgqKc4YH8phs7g96Z8bsdIFNEU3VqXhlHaq+vov/Fgn/sr6MiUczdZkyXRC3TX369Ll4Nzbw==} + jasmine-core@6.0.0: + resolution: {integrity: sha512-fmBb8aruz2mEIDBUGWOGNmxhXwFJs44SSzwbMcBDqQnNChavPTq3Ra9A6WAn6WdxvxWEdakKTcEb3NzeR3yD1A==} jasmine-spec-reporter@7.0.0: resolution: {integrity: sha512-OtC7JRasiTcjsaCBPtMO0Tl8glCejM4J4/dNuOJdA8lBjz4PmWjYQ6pzb0uzpBNAWJMDudYuj9OdXJWqM2QTJg==} @@ -4438,6 +4438,7 @@ packages: tar@7.5.7: resolution: {integrity: sha512-fov56fJiRuThVFXD6o6/Q354S7pnWMJIVlDBYijsTNx6jKSE4pvrDTs6lUnmGvNyfJwFQQwWy3owKz1ucIhveQ==} engines: {node: '>=18'} + deprecated: Old versions of tar are not supported, and contain widely publicized security vulnerabilities, which have been fixed in the current version. Please update. Support for old versions may be purchased (at exorbitant rates) by contacting i@izs.me terser-webpack-plugin@5.3.16: resolution: {integrity: sha512-h9oBFCWrq78NyWWVcSwZarJkZ01c2AyGrzs1crmHZO3QUg9D61Wu4NPjBy69n7JqylFF5y+CsUZYmYEIZ3mR+Q==} @@ -6783,11 +6784,11 @@ snapshots: dependencies: '@types/node': 20.19.31 - '@types/jasmine@5.1.15': {} + '@types/jasmine@6.0.0': {} '@types/jasminewd2@2.0.13': dependencies: - '@types/jasmine': 5.1.15 + '@types/jasmine': 6.0.0 '@types/json-schema@7.0.15': {} @@ -8236,7 +8237,7 @@ snapshots: jasmine-core@4.6.1: {} - jasmine-core@5.13.0: {} + jasmine-core@6.0.0: {} jasmine-spec-reporter@7.0.0: dependencies: @@ -8322,9 +8323,9 @@ snapshots: transitivePeerDependencies: - supports-color - karma-jasmine-html-reporter@2.2.0(jasmine-core@5.13.0)(karma-jasmine@5.1.0(karma@6.4.4))(karma@6.4.4): + karma-jasmine-html-reporter@2.2.0(jasmine-core@6.0.0)(karma-jasmine@5.1.0(karma@6.4.4))(karma@6.4.4): dependencies: - jasmine-core: 5.13.0 + jasmine-core: 6.0.0 karma: 6.4.4 karma-jasmine: 5.1.0(karma@6.4.4) diff --git a/integration/legacy-animations/package.json b/integration/legacy-animations/package.json index 5c665b1f686..76d7fb5e4b4 100644 --- a/integration/legacy-animations/package.json +++ b/integration/legacy-animations/package.json @@ -26,10 +26,10 @@ "@angular-devkit/build-angular": "21.1.0-rc.0", "@angular/cli": "21.1.0-rc.0", "@angular/compiler-cli": "link:./in-existing-linked-by-bazel", - "@types/jasmine": "^5.0.0", + "@types/jasmine": "^6.0.0", "@types/jasminewd2": "^2.0.8", "@types/node": "^20.14.8", - "jasmine-core": "5.13.0", + "jasmine-core": "6.0.1", "jasmine-spec-reporter": "~7.0.0", "karma": "~6.4.0", "karma-chrome-launcher": "^3.1.0", diff --git a/integration/legacy-animations/pnpm-lock.yaml b/integration/legacy-animations/pnpm-lock.yaml index f58ae0a2b95..2ca9a3ff266 100644 --- a/integration/legacy-animations/pnpm-lock.yaml +++ b/integration/legacy-animations/pnpm-lock.yaml @@ -46,8 +46,8 @@ importers: specifier: link:./in-existing-linked-by-bazel version: link:in-existing-linked-by-bazel '@types/jasmine': - specifier: ^5.0.0 - version: 5.1.15 + specifier: ^6.0.0 + version: 6.0.0 '@types/jasminewd2': specifier: ^2.0.8 version: 2.0.13 @@ -55,8 +55,8 @@ importers: specifier: ^20.14.8 version: 20.19.31 jasmine-core: - specifier: 5.13.0 - version: 5.13.0 + specifier: 6.0.1 + version: 6.0.1 jasmine-spec-reporter: specifier: ~7.0.0 version: 7.0.0 @@ -1903,8 +1903,8 @@ packages: '@types/http-proxy@1.17.17': resolution: {integrity: sha512-ED6LB+Z1AVylNTu7hdzuBqOgMnvG/ld6wGCG8wFnAzKX5uyW2K3WD52v0gnLCTK/VLpXtKckgWuyScYK6cSPaw==} - '@types/jasmine@5.1.15': - resolution: {integrity: sha512-ZAC8KjmV2MJxbNTrwXFN+HKeajpXQZp6KpPiR6Aa4XvaEnjP6qh23lL/Rqb7AYzlp3h/rcwDrQ7Gg7q28cQTQg==} + '@types/jasmine@6.0.0': + resolution: {integrity: sha512-18lgGsLmEh3VJk9eZ5wAjTISxdqzl6YOwu8UdMpolajN57QOCNbl+AbHUd+Yu9ItrsFdB+c8LSZSGNg8nHaguw==} '@types/jasminewd2@2.0.13': resolution: {integrity: sha512-aJ3wj8tXMpBrzQ5ghIaqMisD8C3FIrcO6sDKHqFbuqAsI7yOxj0fA7MrRCPLZHIVUjERIwsMmGn/vB0UQ9u0Hg==} @@ -3242,8 +3242,8 @@ packages: jasmine-core@4.6.1: resolution: {integrity: sha512-VYz/BjjmC3klLJlLwA4Kw8ytk0zDSmbbDLNs794VnWmkcCB7I9aAL/D48VNQtmITyPvea2C3jdUMfc3kAoy0PQ==} - jasmine-core@5.13.0: - resolution: {integrity: sha512-vsYjfh7lyqvZX5QgqKc4YH8phs7g96Z8bsdIFNEU3VqXhlHaq+vov/Fgn/sr6MiUczdZkyXRC3TX369Ll4Nzbw==} + jasmine-core@6.0.1: + resolution: {integrity: sha512-gUtzV5ASR0MLBwDNqri4kBsgKNCcRQd9qOlNw/w/deavD0cl3JmWXXfH8JhKM4LTg6LPTt2IOQ4px3YYfgh2Xg==} jasmine-spec-reporter@7.0.0: resolution: {integrity: sha512-OtC7JRasiTcjsaCBPtMO0Tl8glCejM4J4/dNuOJdA8lBjz4PmWjYQ6pzb0uzpBNAWJMDudYuj9OdXJWqM2QTJg==} @@ -4402,6 +4402,7 @@ packages: tar@7.5.7: resolution: {integrity: sha512-fov56fJiRuThVFXD6o6/Q354S7pnWMJIVlDBYijsTNx6jKSE4pvrDTs6lUnmGvNyfJwFQQwWy3owKz1ucIhveQ==} engines: {node: '>=18'} + deprecated: Old versions of tar are not supported, and contain widely publicized security vulnerabilities, which have been fixed in the current version. Please update. Support for old versions may be purchased (at exorbitant rates) by contacting i@izs.me terser-webpack-plugin@5.3.16: resolution: {integrity: sha512-h9oBFCWrq78NyWWVcSwZarJkZ01c2AyGrzs1crmHZO3QUg9D61Wu4NPjBy69n7JqylFF5y+CsUZYmYEIZ3mR+Q==} @@ -6747,11 +6748,11 @@ snapshots: dependencies: '@types/node': 20.19.31 - '@types/jasmine@5.1.15': {} + '@types/jasmine@6.0.0': {} '@types/jasminewd2@2.0.13': dependencies: - '@types/jasmine': 5.1.15 + '@types/jasmine': 6.0.0 '@types/json-schema@7.0.15': {} @@ -8175,7 +8176,7 @@ snapshots: jasmine-core@4.6.1: {} - jasmine-core@5.13.0: {} + jasmine-core@6.0.1: {} jasmine-spec-reporter@7.0.0: dependencies: @@ -8253,7 +8254,7 @@ snapshots: karma-jasmine-html-reporter@2.2.0(jasmine-core@5.13.0)(karma-jasmine@5.1.0(karma@6.4.4))(karma@6.4.4): dependencies: - jasmine-core: 5.13.0 + jasmine-core: 6.0.1 karma: 6.4.4 karma-jasmine: 5.1.0(karma@6.4.4) diff --git a/integration/ng_elements/package.json b/integration/ng_elements/package.json index 85ecc3f1e79..b00281d023d 100644 --- a/integration/ng_elements/package.json +++ b/integration/ng_elements/package.json @@ -18,7 +18,7 @@ "@babel/core": "7.29.0", "@rollup/plugin-babel": "^6.0.0", "@rollup/plugin-node-resolve": "^16.0.0", - "@types/jasmine": "^5.0.0", + "@types/jasmine": "^6.0.0", "@types/jasminewd2": "^2.0.8", "concurrently": "9.2.1", "lite-server": "2.6.1", diff --git a/integration/ng_elements/pnpm-lock.yaml b/integration/ng_elements/pnpm-lock.yaml index 5f4144ec513..ced8045a41f 100644 --- a/integration/ng_elements/pnpm-lock.yaml +++ b/integration/ng_elements/pnpm-lock.yaml @@ -49,8 +49,8 @@ importers: specifier: ^16.0.0 version: 16.0.3(rollup@4.57.1) '@types/jasmine': - specifier: ^5.0.0 - version: 5.1.15 + specifier: ^6.0.0 + version: 6.0.0 '@types/jasminewd2': specifier: ^2.0.8 version: 2.0.13 @@ -330,8 +330,8 @@ packages: '@types/estree@1.0.8': resolution: {integrity: sha512-dWHzHa2WqEXI/O1E9OjrocMTKJl2mSrEolh1Iomrv6U+JuNwaHXsXx9bLu5gG7BUWFIN0skIQJQ/L1rIex4X6w==} - '@types/jasmine@5.1.15': - resolution: {integrity: sha512-ZAC8KjmV2MJxbNTrwXFN+HKeajpXQZp6KpPiR6Aa4XvaEnjP6qh23lL/Rqb7AYzlp3h/rcwDrQ7Gg7q28cQTQg==} + '@types/jasmine@6.0.0': + resolution: {integrity: sha512-18lgGsLmEh3VJk9eZ5wAjTISxdqzl6YOwu8UdMpolajN57QOCNbl+AbHUd+Yu9ItrsFdB+c8LSZSGNg8nHaguw==} '@types/jasminewd2@2.0.13': resolution: {integrity: sha512-aJ3wj8tXMpBrzQ5ghIaqMisD8C3FIrcO6sDKHqFbuqAsI7yOxj0fA7MrRCPLZHIVUjERIwsMmGn/vB0UQ9u0Hg==} @@ -1725,11 +1725,11 @@ snapshots: '@types/estree@1.0.8': {} - '@types/jasmine@5.1.15': {} + '@types/jasmine@6.0.0': {} '@types/jasminewd2@2.0.13': dependencies: - '@types/jasmine': 5.1.15 + '@types/jasmine': 6.0.0 '@types/node@25.2.0': dependencies: diff --git a/integration/nodenext_resolution/package.json b/integration/nodenext_resolution/package.json index 807f93d09e3..a755fffd9ba 100644 --- a/integration/nodenext_resolution/package.json +++ b/integration/nodenext_resolution/package.json @@ -19,7 +19,7 @@ "@angular/router": "link:./in-existing-linked-by-bazel", "@angular/service-worker": "link:./in-existing-linked-by-bazel", "@angular/upgrade": "link:./in-existing-linked-by-bazel", - "@types/jasmine": "^5.0.0", + "@types/jasmine": "^6.0.0", "rxjs": "^7.0.0", "typescript": "5.9.3", "zone.js": "0.16.0" diff --git a/integration/nodenext_resolution/pnpm-lock.yaml b/integration/nodenext_resolution/pnpm-lock.yaml index 71d7d3f52ba..6171d88b2ae 100644 --- a/integration/nodenext_resolution/pnpm-lock.yaml +++ b/integration/nodenext_resolution/pnpm-lock.yaml @@ -51,8 +51,8 @@ importers: specifier: link:./in-existing-linked-by-bazel version: link:in-existing-linked-by-bazel '@types/jasmine': - specifier: ^5.0.0 - version: 5.1.15 + specifier: ^6.0.0 + version: 6.0.0 rxjs: specifier: ^7.0.0 version: 7.8.2 @@ -65,8 +65,8 @@ importers: packages: - '@types/jasmine@5.1.15': - resolution: {integrity: sha512-ZAC8KjmV2MJxbNTrwXFN+HKeajpXQZp6KpPiR6Aa4XvaEnjP6qh23lL/Rqb7AYzlp3h/rcwDrQ7Gg7q28cQTQg==} + '@types/jasmine@6.0.0': + resolution: {integrity: sha512-18lgGsLmEh3VJk9eZ5wAjTISxdqzl6YOwu8UdMpolajN57QOCNbl+AbHUd+Yu9ItrsFdB+c8LSZSGNg8nHaguw==} rxjs@7.8.2: resolution: {integrity: sha512-dhKf903U/PQZY6boNNtAGdWbG85WAbjT/1xYoZIC7FAY0yWapOBQVsVrDl58W86//e1VpMNBtRV4MaXfdMySFA==} @@ -84,7 +84,7 @@ packages: snapshots: - '@types/jasmine@5.1.15': {} + '@types/jasmine@6.0.0': {} rxjs@7.8.2: dependencies: diff --git a/integration/platform-server-hydration/package.json b/integration/platform-server-hydration/package.json index 80d06b53ae2..5d646a5c79f 100644 --- a/integration/platform-server-hydration/package.json +++ b/integration/platform-server-hydration/package.json @@ -29,10 +29,10 @@ "@angular/build": "21.1.0-rc.0", "@angular/cli": "21.1.0-rc.0", "@angular/compiler-cli": "link:./in-existing-linked-by-bazel", - "@types/jasmine": "^5.0.0", + "@types/jasmine": "^6.0.0", "@types/node": "^20.14.8", "@types/selenium-webdriver": "3.0.7", - "jasmine-core": "5.13.0", + "jasmine-core": "6.0.1", "jasmine-spec-reporter": "~7.0.0", "protractor": "^7.0.0", "selenium-webdriver": "3.5.0", diff --git a/integration/platform-server-hydration/pnpm-lock.yaml b/integration/platform-server-hydration/pnpm-lock.yaml index ee6c6744976..fa186c18860 100644 --- a/integration/platform-server-hydration/pnpm-lock.yaml +++ b/integration/platform-server-hydration/pnpm-lock.yaml @@ -55,8 +55,8 @@ importers: specifier: link:./in-existing-linked-by-bazel version: link:in-existing-linked-by-bazel '@types/jasmine': - specifier: ^5.0.0 - version: 5.1.15 + specifier: ^6.0.0 + version: 6.0.0 '@types/node': specifier: ^20.14.8 version: 20.19.31 @@ -64,8 +64,8 @@ importers: specifier: 3.0.7 version: 3.0.7 jasmine-core: - specifier: 5.13.0 - version: 5.13.0 + specifier: 6.0.1 + version: 6.0.1 jasmine-spec-reporter: specifier: ~7.0.0 version: 7.0.0 @@ -1904,8 +1904,8 @@ packages: '@types/http-proxy@1.17.17': resolution: {integrity: sha512-ED6LB+Z1AVylNTu7hdzuBqOgMnvG/ld6wGCG8wFnAzKX5uyW2K3WD52v0gnLCTK/VLpXtKckgWuyScYK6cSPaw==} - '@types/jasmine@5.1.15': - resolution: {integrity: sha512-ZAC8KjmV2MJxbNTrwXFN+HKeajpXQZp6KpPiR6Aa4XvaEnjP6qh23lL/Rqb7AYzlp3h/rcwDrQ7Gg7q28cQTQg==} + '@types/jasmine@6.0.0': + resolution: {integrity: sha512-18lgGsLmEh3VJk9eZ5wAjTISxdqzl6YOwu8UdMpolajN57QOCNbl+AbHUd+Yu9ItrsFdB+c8LSZSGNg8nHaguw==} '@types/json-schema@7.0.15': resolution: {integrity: sha512-5+fP8P8MFNC+AyZCDxrB2pkZFPGzqQWUzpSeuuVLvm8VMcorNYavBqoFcxK8bQz4Qsbn4oUEEem4wDLfcysGHA==} @@ -3174,8 +3174,8 @@ packages: jasmine-core@2.8.0: resolution: {integrity: sha512-SNkOkS+/jMZvLhuSx1fjhcNWUC/KG6oVyFUGkSBEr9n1axSNduWU8GlI7suaHXr4yxjet6KjrUZxUTE5WzzWwQ==} - jasmine-core@5.13.0: - resolution: {integrity: sha512-vsYjfh7lyqvZX5QgqKc4YH8phs7g96Z8bsdIFNEU3VqXhlHaq+vov/Fgn/sr6MiUczdZkyXRC3TX369Ll4Nzbw==} + jasmine-core@6.0.1: + resolution: {integrity: sha512-gUtzV5ASR0MLBwDNqri4kBsgKNCcRQd9qOlNw/w/deavD0cl3JmWXXfH8JhKM4LTg6LPTt2IOQ4px3YYfgh2Xg==} jasmine-spec-reporter@7.0.0: resolution: {integrity: sha512-OtC7JRasiTcjsaCBPtMO0Tl8glCejM4J4/dNuOJdA8lBjz4PmWjYQ6pzb0uzpBNAWJMDudYuj9OdXJWqM2QTJg==} @@ -4263,6 +4263,7 @@ packages: tar@7.5.7: resolution: {integrity: sha512-fov56fJiRuThVFXD6o6/Q354S7pnWMJIVlDBYijsTNx6jKSE4pvrDTs6lUnmGvNyfJwFQQwWy3owKz1ucIhveQ==} engines: {node: '>=18'} + deprecated: Old versions of tar are not supported, and contain widely publicized security vulnerabilities, which have been fixed in the current version. Please update. Support for old versions may be purchased (at exorbitant rates) by contacting i@izs.me terser-webpack-plugin@5.3.16: resolution: {integrity: sha512-h9oBFCWrq78NyWWVcSwZarJkZ01c2AyGrzs1crmHZO3QUg9D61Wu4NPjBy69n7JqylFF5y+CsUZYmYEIZ3mR+Q==} @@ -6567,7 +6568,7 @@ snapshots: dependencies: '@types/node': 20.19.31 - '@types/jasmine@5.1.15': {} + '@types/jasmine@6.0.0': {} '@types/json-schema@7.0.15': {} @@ -7899,7 +7900,7 @@ snapshots: jasmine-core@2.8.0: {} - jasmine-core@5.13.0: {} + jasmine-core@6.0.1: {} jasmine-spec-reporter@7.0.0: dependencies: diff --git a/integration/platform-server-zoneless/package.json b/integration/platform-server-zoneless/package.json index 5303c802c4c..5a1cc040145 100644 --- a/integration/platform-server-zoneless/package.json +++ b/integration/platform-server-zoneless/package.json @@ -32,11 +32,11 @@ "@angular/cli": "21.1.0-rc.0", "@angular/compiler-cli": "link:./in-existing-linked-by-bazel", "@types/express": "^5.0.3", - "@types/jasmine": "^5.0.0", + "@types/jasmine": "^6.0.0", "@types/node": "^20.14.8", "@types/selenium-webdriver": "3.0.7", "concurrently": "9.2.1", - "jasmine-core": "5.13.0", + "jasmine-core": "6.0.1", "jasmine-spec-reporter": "~7.0.0", "protractor": "^7.0.0", "selenium-webdriver": "3.5.0", diff --git a/integration/platform-server-zoneless/pnpm-lock.yaml b/integration/platform-server-zoneless/pnpm-lock.yaml index 092633e3395..c1d5e859ede 100644 --- a/integration/platform-server-zoneless/pnpm-lock.yaml +++ b/integration/platform-server-zoneless/pnpm-lock.yaml @@ -61,8 +61,8 @@ importers: specifier: ^5.0.3 version: 5.0.6 '@types/jasmine': - specifier: ^5.0.0 - version: 5.1.15 + specifier: ^6.0.0 + version: 6.0.0 '@types/node': specifier: ^20.14.8 version: 20.19.31 @@ -73,8 +73,8 @@ importers: specifier: 9.2.1 version: 9.2.1 jasmine-core: - specifier: 5.13.0 - version: 5.13.0 + specifier: 6.0.1 + version: 6.0.1 jasmine-spec-reporter: specifier: ~7.0.0 version: 7.0.0 @@ -1919,8 +1919,8 @@ packages: '@types/http-proxy@1.17.17': resolution: {integrity: sha512-ED6LB+Z1AVylNTu7hdzuBqOgMnvG/ld6wGCG8wFnAzKX5uyW2K3WD52v0gnLCTK/VLpXtKckgWuyScYK6cSPaw==} - '@types/jasmine@5.1.15': - resolution: {integrity: sha512-ZAC8KjmV2MJxbNTrwXFN+HKeajpXQZp6KpPiR6Aa4XvaEnjP6qh23lL/Rqb7AYzlp3h/rcwDrQ7Gg7q28cQTQg==} + '@types/jasmine@6.0.0': + resolution: {integrity: sha512-18lgGsLmEh3VJk9eZ5wAjTISxdqzl6YOwu8UdMpolajN57QOCNbl+AbHUd+Yu9ItrsFdB+c8LSZSGNg8nHaguw==} '@types/json-schema@7.0.15': resolution: {integrity: sha512-5+fP8P8MFNC+AyZCDxrB2pkZFPGzqQWUzpSeuuVLvm8VMcorNYavBqoFcxK8bQz4Qsbn4oUEEem4wDLfcysGHA==} @@ -3205,8 +3205,8 @@ packages: jasmine-core@2.8.0: resolution: {integrity: sha512-SNkOkS+/jMZvLhuSx1fjhcNWUC/KG6oVyFUGkSBEr9n1axSNduWU8GlI7suaHXr4yxjet6KjrUZxUTE5WzzWwQ==} - jasmine-core@5.13.0: - resolution: {integrity: sha512-vsYjfh7lyqvZX5QgqKc4YH8phs7g96Z8bsdIFNEU3VqXhlHaq+vov/Fgn/sr6MiUczdZkyXRC3TX369Ll4Nzbw==} + jasmine-core@6.0.1: + resolution: {integrity: sha512-gUtzV5ASR0MLBwDNqri4kBsgKNCcRQd9qOlNw/w/deavD0cl3JmWXXfH8JhKM4LTg6LPTt2IOQ4px3YYfgh2Xg==} jasmine-spec-reporter@7.0.0: resolution: {integrity: sha512-OtC7JRasiTcjsaCBPtMO0Tl8glCejM4J4/dNuOJdA8lBjz4PmWjYQ6pzb0uzpBNAWJMDudYuj9OdXJWqM2QTJg==} @@ -4298,6 +4298,7 @@ packages: tar@7.5.7: resolution: {integrity: sha512-fov56fJiRuThVFXD6o6/Q354S7pnWMJIVlDBYijsTNx6jKSE4pvrDTs6lUnmGvNyfJwFQQwWy3owKz1ucIhveQ==} engines: {node: '>=18'} + deprecated: Old versions of tar are not supported, and contain widely publicized security vulnerabilities, which have been fixed in the current version. Please update. Support for old versions may be purchased (at exorbitant rates) by contacting i@izs.me terser-webpack-plugin@5.3.16: resolution: {integrity: sha512-h9oBFCWrq78NyWWVcSwZarJkZ01c2AyGrzs1crmHZO3QUg9D61Wu4NPjBy69n7JqylFF5y+CsUZYmYEIZ3mR+Q==} @@ -6624,7 +6625,7 @@ snapshots: dependencies: '@types/node': 20.19.31 - '@types/jasmine@5.1.15': {} + '@types/jasmine@6.0.0': {} '@types/json-schema@7.0.15': {} @@ -7981,7 +7982,7 @@ snapshots: jasmine-core@2.8.0: {} - jasmine-core@5.13.0: {} + jasmine-core@6.0.1: {} jasmine-spec-reporter@7.0.0: dependencies: diff --git a/integration/platform-server/package.json b/integration/platform-server/package.json index ac31435f351..ce4a628ed49 100644 --- a/integration/platform-server/package.json +++ b/integration/platform-server/package.json @@ -36,11 +36,11 @@ "@angular/cli": "21.1.0-rc.0", "@angular/compiler-cli": "link:./in-existing-linked-by-bazel", "@types/express": "^5.0.3", - "@types/jasmine": "^5.0.0", + "@types/jasmine": "^6.0.0", "@types/node": "^20.14.8", "@types/selenium-webdriver": "3.0.7", "concurrently": "9.2.1", - "jasmine-core": "5.13.0", + "jasmine-core": "6.0.1", "jasmine-spec-reporter": "~7.0.0", "protractor": "^7.0.0", "selenium-webdriver": "3.5.0", diff --git a/integration/platform-server/pnpm-lock.yaml b/integration/platform-server/pnpm-lock.yaml index fe70ea6313b..0a25067a39c 100644 --- a/integration/platform-server/pnpm-lock.yaml +++ b/integration/platform-server/pnpm-lock.yaml @@ -64,8 +64,8 @@ importers: specifier: ^5.0.3 version: 5.0.6 '@types/jasmine': - specifier: ^5.0.0 - version: 5.1.15 + specifier: ^6.0.0 + version: 6.0.0 '@types/node': specifier: ^20.14.8 version: 20.19.31 @@ -76,8 +76,8 @@ importers: specifier: 9.2.1 version: 9.2.1 jasmine-core: - specifier: 5.13.0 - version: 5.13.0 + specifier: 6.0.1 + version: 6.0.1 jasmine-spec-reporter: specifier: ~7.0.0 version: 7.0.0 @@ -1922,8 +1922,8 @@ packages: '@types/http-proxy@1.17.17': resolution: {integrity: sha512-ED6LB+Z1AVylNTu7hdzuBqOgMnvG/ld6wGCG8wFnAzKX5uyW2K3WD52v0gnLCTK/VLpXtKckgWuyScYK6cSPaw==} - '@types/jasmine@5.1.15': - resolution: {integrity: sha512-ZAC8KjmV2MJxbNTrwXFN+HKeajpXQZp6KpPiR6Aa4XvaEnjP6qh23lL/Rqb7AYzlp3h/rcwDrQ7Gg7q28cQTQg==} + '@types/jasmine@6.0.0': + resolution: {integrity: sha512-18lgGsLmEh3VJk9eZ5wAjTISxdqzl6YOwu8UdMpolajN57QOCNbl+AbHUd+Yu9ItrsFdB+c8LSZSGNg8nHaguw==} '@types/json-schema@7.0.15': resolution: {integrity: sha512-5+fP8P8MFNC+AyZCDxrB2pkZFPGzqQWUzpSeuuVLvm8VMcorNYavBqoFcxK8bQz4Qsbn4oUEEem4wDLfcysGHA==} @@ -3208,8 +3208,8 @@ packages: jasmine-core@2.8.0: resolution: {integrity: sha512-SNkOkS+/jMZvLhuSx1fjhcNWUC/KG6oVyFUGkSBEr9n1axSNduWU8GlI7suaHXr4yxjet6KjrUZxUTE5WzzWwQ==} - jasmine-core@5.13.0: - resolution: {integrity: sha512-vsYjfh7lyqvZX5QgqKc4YH8phs7g96Z8bsdIFNEU3VqXhlHaq+vov/Fgn/sr6MiUczdZkyXRC3TX369Ll4Nzbw==} + jasmine-core@6.0.1: + resolution: {integrity: sha512-gUtzV5ASR0MLBwDNqri4kBsgKNCcRQd9qOlNw/w/deavD0cl3JmWXXfH8JhKM4LTg6LPTt2IOQ4px3YYfgh2Xg==} jasmine-spec-reporter@7.0.0: resolution: {integrity: sha512-OtC7JRasiTcjsaCBPtMO0Tl8glCejM4J4/dNuOJdA8lBjz4PmWjYQ6pzb0uzpBNAWJMDudYuj9OdXJWqM2QTJg==} @@ -4301,6 +4301,7 @@ packages: tar@7.5.7: resolution: {integrity: sha512-fov56fJiRuThVFXD6o6/Q354S7pnWMJIVlDBYijsTNx6jKSE4pvrDTs6lUnmGvNyfJwFQQwWy3owKz1ucIhveQ==} engines: {node: '>=18'} + deprecated: Old versions of tar are not supported, and contain widely publicized security vulnerabilities, which have been fixed in the current version. Please update. Support for old versions may be purchased (at exorbitant rates) by contacting i@izs.me terser-webpack-plugin@5.3.16: resolution: {integrity: sha512-h9oBFCWrq78NyWWVcSwZarJkZ01c2AyGrzs1crmHZO3QUg9D61Wu4NPjBy69n7JqylFF5y+CsUZYmYEIZ3mR+Q==} @@ -6630,7 +6631,7 @@ snapshots: dependencies: '@types/node': 20.19.31 - '@types/jasmine@5.1.15': {} + '@types/jasmine@6.0.0': {} '@types/json-schema@7.0.15': {} @@ -7987,7 +7988,7 @@ snapshots: jasmine-core@2.8.0: {} - jasmine-core@5.13.0: {} + jasmine-core@6.0.1: {} jasmine-spec-reporter@7.0.0: dependencies: diff --git a/integration/trusted-types/package.json b/integration/trusted-types/package.json index 7588835e466..84dc8838019 100644 --- a/integration/trusted-types/package.json +++ b/integration/trusted-types/package.json @@ -29,15 +29,15 @@ "@angular/build": "21.1.0-rc.0", "@angular/cli": "21.1.0-rc.0", "@angular/compiler-cli": "link:./in-existing-linked-by-bazel", - "@types/jasmine": "^5.0.0", + "@types/jasmine": "^6.0.0", "@types/node": "^20.14.8", - "jasmine-core": "5.13.0", + "jasmine-core": "6.0.1", "jasmine-spec-reporter": "~7.0.0", "karma": "~6.4.0", "karma-chrome-launcher": "^3.1.0", "karma-coverage": "^2.2.1", "karma-jasmine": "^5.0.0", - "karma-jasmine-html-reporter": "^2.1.0", + "karma-jasmine-html-reporter": "^2.2.0", "protractor": "^7.0.0", "ts-node": "^10.9.1", "typescript": "5.9.3" diff --git a/integration/trusted-types/pnpm-lock.yaml b/integration/trusted-types/pnpm-lock.yaml index 8cfe7ec1583..afc6b287acd 100644 --- a/integration/trusted-types/pnpm-lock.yaml +++ b/integration/trusted-types/pnpm-lock.yaml @@ -55,14 +55,14 @@ importers: specifier: link:./in-existing-linked-by-bazel version: link:in-existing-linked-by-bazel '@types/jasmine': - specifier: ^5.0.0 - version: 5.1.15 + specifier: ^6.0.0 + version: 6.0.0 '@types/node': specifier: ^20.14.8 version: 20.19.31 jasmine-core: - specifier: 5.13.0 - version: 5.13.0 + specifier: 6.0.1 + version: 6.0.1 jasmine-spec-reporter: specifier: ~7.0.0 version: 7.0.0 @@ -79,8 +79,8 @@ importers: specifier: ^5.0.0 version: 5.1.0(karma@6.4.4) karma-jasmine-html-reporter: - specifier: ^2.1.0 - version: 2.2.0(jasmine-core@5.13.0)(karma-jasmine@5.1.0(karma@6.4.4))(karma@6.4.4) + specifier: ^2.2.0 + version: 2.2.0(jasmine-core@6.0.1)(karma-jasmine@5.1.0(karma@6.4.4))(karma@6.4.4) protractor: specifier: ^7.0.0 version: 7.0.0 @@ -1927,8 +1927,8 @@ packages: '@types/http-proxy@1.17.17': resolution: {integrity: sha512-ED6LB+Z1AVylNTu7hdzuBqOgMnvG/ld6wGCG8wFnAzKX5uyW2K3WD52v0gnLCTK/VLpXtKckgWuyScYK6cSPaw==} - '@types/jasmine@5.1.15': - resolution: {integrity: sha512-ZAC8KjmV2MJxbNTrwXFN+HKeajpXQZp6KpPiR6Aa4XvaEnjP6qh23lL/Rqb7AYzlp3h/rcwDrQ7Gg7q28cQTQg==} + '@types/jasmine@6.0.0': + resolution: {integrity: sha512-18lgGsLmEh3VJk9eZ5wAjTISxdqzl6YOwu8UdMpolajN57QOCNbl+AbHUd+Yu9ItrsFdB+c8LSZSGNg8nHaguw==} '@types/json-schema@7.0.15': resolution: {integrity: sha512-5+fP8P8MFNC+AyZCDxrB2pkZFPGzqQWUzpSeuuVLvm8VMcorNYavBqoFcxK8bQz4Qsbn4oUEEem4wDLfcysGHA==} @@ -3282,8 +3282,8 @@ packages: jasmine-core@4.6.1: resolution: {integrity: sha512-VYz/BjjmC3klLJlLwA4Kw8ytk0zDSmbbDLNs794VnWmkcCB7I9aAL/D48VNQtmITyPvea2C3jdUMfc3kAoy0PQ==} - jasmine-core@5.13.0: - resolution: {integrity: sha512-vsYjfh7lyqvZX5QgqKc4YH8phs7g96Z8bsdIFNEU3VqXhlHaq+vov/Fgn/sr6MiUczdZkyXRC3TX369Ll4Nzbw==} + jasmine-core@6.0.1: + resolution: {integrity: sha512-gUtzV5ASR0MLBwDNqri4kBsgKNCcRQd9qOlNw/w/deavD0cl3JmWXXfH8JhKM4LTg6LPTt2IOQ4px3YYfgh2Xg==} jasmine-spec-reporter@7.0.0: resolution: {integrity: sha512-OtC7JRasiTcjsaCBPtMO0Tl8glCejM4J4/dNuOJdA8lBjz4PmWjYQ6pzb0uzpBNAWJMDudYuj9OdXJWqM2QTJg==} @@ -4454,6 +4454,7 @@ packages: tar@7.5.7: resolution: {integrity: sha512-fov56fJiRuThVFXD6o6/Q354S7pnWMJIVlDBYijsTNx6jKSE4pvrDTs6lUnmGvNyfJwFQQwWy3owKz1ucIhveQ==} engines: {node: '>=18'} + deprecated: Old versions of tar are not supported, and contain widely publicized security vulnerabilities, which have been fixed in the current version. Please update. Support for old versions may be purchased (at exorbitant rates) by contacting i@izs.me terser-webpack-plugin@5.3.16: resolution: {integrity: sha512-h9oBFCWrq78NyWWVcSwZarJkZ01c2AyGrzs1crmHZO3QUg9D61Wu4NPjBy69n7JqylFF5y+CsUZYmYEIZ3mR+Q==} @@ -6837,7 +6838,7 @@ snapshots: dependencies: '@types/node': 20.19.31 - '@types/jasmine@5.1.15': {} + '@types/jasmine@6.0.0': {} '@types/json-schema@7.0.15': {} @@ -8292,7 +8293,7 @@ snapshots: jasmine-core@4.6.1: {} - jasmine-core@5.13.0: {} + jasmine-core@6.0.1: {} jasmine-spec-reporter@7.0.0: dependencies: @@ -8381,7 +8382,7 @@ snapshots: karma-jasmine-html-reporter@2.2.0(jasmine-core@5.13.0)(karma-jasmine@5.1.0(karma@6.4.4))(karma@6.4.4): dependencies: - jasmine-core: 5.13.0 + jasmine-core: 6.0.1 karma: 6.4.4 karma-jasmine: 5.1.0(karma@6.4.4) diff --git a/integration/typings_test_rxjs7/package.json b/integration/typings_test_rxjs7/package.json index 8da722fdd9f..22f4040981e 100644 --- a/integration/typings_test_rxjs7/package.json +++ b/integration/typings_test_rxjs7/package.json @@ -17,7 +17,7 @@ "@angular/router": "link:./in-existing-linked-by-bazel", "@angular/service-worker": "link:./in-existing-linked-by-bazel", "@angular/upgrade": "link:./in-existing-linked-by-bazel", - "@types/jasmine": "^5.0.0", + "@types/jasmine": "^6.0.0", "@types/node": "^20.14.8", "rxjs": "^7.0.0", "typescript": "5.9.3", diff --git a/integration/typings_test_rxjs7/pnpm-lock.yaml b/integration/typings_test_rxjs7/pnpm-lock.yaml index f07588078af..5b92129ae34 100644 --- a/integration/typings_test_rxjs7/pnpm-lock.yaml +++ b/integration/typings_test_rxjs7/pnpm-lock.yaml @@ -48,8 +48,8 @@ importers: specifier: link:./in-existing-linked-by-bazel version: link:in-existing-linked-by-bazel '@types/jasmine': - specifier: ^5.0.0 - version: 5.1.15 + specifier: ^6.0.0 + version: 6.0.0 '@types/node': specifier: ^20.14.8 version: 20.19.31 @@ -65,8 +65,8 @@ importers: packages: - '@types/jasmine@5.1.15': - resolution: {integrity: sha512-ZAC8KjmV2MJxbNTrwXFN+HKeajpXQZp6KpPiR6Aa4XvaEnjP6qh23lL/Rqb7AYzlp3h/rcwDrQ7Gg7q28cQTQg==} + '@types/jasmine@6.0.0': + resolution: {integrity: sha512-18lgGsLmEh3VJk9eZ5wAjTISxdqzl6YOwu8UdMpolajN57QOCNbl+AbHUd+Yu9ItrsFdB+c8LSZSGNg8nHaguw==} '@types/node@20.19.31': resolution: {integrity: sha512-5jsi0wpncvTD33Sh1UCgacK37FFwDn+EG7wCmEvs62fCvBL+n8/76cAYDok21NF6+jaVWIqKwCZyX7Vbu8eB3A==} @@ -90,7 +90,7 @@ packages: snapshots: - '@types/jasmine@5.1.15': {} + '@types/jasmine@6.0.0': {} '@types/node@20.19.31': dependencies: diff --git a/integration/typings_test_ts59/package.json b/integration/typings_test_ts59/package.json index 49954f16026..6e058308b61 100644 --- a/integration/typings_test_ts59/package.json +++ b/integration/typings_test_ts59/package.json @@ -18,7 +18,7 @@ "@angular/router": "link:./in-existing-linked-by-bazel", "@angular/service-worker": "link:./in-existing-linked-by-bazel", "@angular/upgrade": "link:./in-existing-linked-by-bazel", - "@types/jasmine": "^5.0.0", + "@types/jasmine": "^6.0.0", "rxjs": "^7.0.0", "typescript": "5.9.3", "zone.js": "0.16.0" diff --git a/integration/typings_test_ts59/pnpm-lock.yaml b/integration/typings_test_ts59/pnpm-lock.yaml index 71d7d3f52ba..6171d88b2ae 100644 --- a/integration/typings_test_ts59/pnpm-lock.yaml +++ b/integration/typings_test_ts59/pnpm-lock.yaml @@ -51,8 +51,8 @@ importers: specifier: link:./in-existing-linked-by-bazel version: link:in-existing-linked-by-bazel '@types/jasmine': - specifier: ^5.0.0 - version: 5.1.15 + specifier: ^6.0.0 + version: 6.0.0 rxjs: specifier: ^7.0.0 version: 7.8.2 @@ -65,8 +65,8 @@ importers: packages: - '@types/jasmine@5.1.15': - resolution: {integrity: sha512-ZAC8KjmV2MJxbNTrwXFN+HKeajpXQZp6KpPiR6Aa4XvaEnjP6qh23lL/Rqb7AYzlp3h/rcwDrQ7Gg7q28cQTQg==} + '@types/jasmine@6.0.0': + resolution: {integrity: sha512-18lgGsLmEh3VJk9eZ5wAjTISxdqzl6YOwu8UdMpolajN57QOCNbl+AbHUd+Yu9ItrsFdB+c8LSZSGNg8nHaguw==} rxjs@7.8.2: resolution: {integrity: sha512-dhKf903U/PQZY6boNNtAGdWbG85WAbjT/1xYoZIC7FAY0yWapOBQVsVrDl58W86//e1VpMNBtRV4MaXfdMySFA==} @@ -84,7 +84,7 @@ packages: snapshots: - '@types/jasmine@5.1.15': {} + '@types/jasmine@6.0.0': {} rxjs@7.8.2: dependencies: diff --git a/modules/package.json b/modules/package.json index 3ec497fa5a4..83c85748d38 100644 --- a/modules/package.json +++ b/modules/package.json @@ -13,7 +13,7 @@ "@angular/platform-browser": "workspace:*", "@angular/router": "workspace:*", "@angular/upgrade": "workspace:*", - "@types/jasmine": "5.1.15", + "@types/jasmine": "6.0.0", "@types/jasminewd2": "2.0.13", "@types/node": "24.10.11", "@types/selenium-webdriver": "3.0.7", diff --git a/package.json b/package.json index 97c3020980b..f820e7972c5 100644 --- a/package.json +++ b/package.json @@ -94,7 +94,7 @@ "@types/dom-navigation": "^1.0.5", "@types/firefox-webext-browser": "^143.0.0", "@types/hammerjs": "2.0.46", - "@types/jasmine": "^5.0.0", + "@types/jasmine": "^6.0.0", "@types/jasminewd2": "^2.0.8", "@types/node": "^20.14.8", "@types/selenium-webdriver": "3.0.7", @@ -120,8 +120,8 @@ "esbuild": "0.27.2", "esbuild-plugin-umd-wrapper": "^3.0.0", "http-server": "^14.0.0", - "jasmine": "5.13.0", - "jasmine-core": "5.13.0", + "jasmine": "6.0.0", + "jasmine-core": "6.0.0", "jasmine-reporters": "^2.5.2", "karma": "~6.4.0", "karma-chrome-launcher": "^3.1.0", @@ -187,7 +187,7 @@ "gulp-conventional-changelog": "^5.0.0", "husky": "9.1.7", "karma-coverage": "^2.2.1", - "karma-jasmine-html-reporter": "^2.1.0", + "karma-jasmine-html-reporter": "^2.2.0", "karma-sauce-launcher": "^4.3.6", "prettier": "^3.8.0", "rollup-plugin-sourcemaps2": "^0.5.1", diff --git a/packages/common/test/image_loaders/image_loader_spec.ts b/packages/common/test/image_loaders/image_loader_spec.ts index 2f94c3d11b2..b5f2fdcad45 100644 --- a/packages/common/test/image_loaders/image_loader_spec.ts +++ b/packages/common/test/image_loaders/image_loader_spec.ts @@ -6,6 +6,8 @@ * found in the LICENSE file at https://angular.dev/license */ +import {createEnvironmentInjector, EnvironmentInjector} from '@angular/core'; +import {TestBed} from '@angular/core/testing'; import { IMAGE_LOADER, ImageLoader, @@ -18,8 +20,6 @@ import {provideImageKitLoader} from '../../src/directives/ng_optimized_image/ima import {provideImgixLoader} from '../../src/directives/ng_optimized_image/image_loaders/imgix_loader'; import {isValidPath} from '../../src/directives/ng_optimized_image/url'; import {RuntimeErrorCode} from '../../src/errors'; -import {createEnvironmentInjector, EnvironmentInjector} from '@angular/core'; -import {TestBed} from '@angular/core/testing'; const absoluteUrlError = (src: string, path: string) => `NG02959: Image loader has detected a \`\` tag with an invalid ` + @@ -49,21 +49,21 @@ describe('Built-in image directive loaders', () => { expect(loader(config)).toBe(`${path}/img.png?auto=format`); }); - it('should handle a trailing forward slash on the path', () => { + it('should handle a trailing forward slash on the path (slash when creating loader)', () => { const path = 'https://somesite.imgix.net'; const loader = createImgixLoader(`${path}/`); const config = {src: 'img.png'}; expect(loader(config)).toBe(`${path}/img.png?auto=format`); }); - it('should handle a leading forward slash on the image src', () => { + it('should handle a leading forward slash on the image src (slash in config)', () => { const path = 'https://somesite.imgix.net'; const loader = createImgixLoader(path); const config = {src: '/img.png'}; expect(loader(config)).toBe(`${path}/img.png?auto=format`); }); - it('should construct an image loader with the given path', () => { + it('should construct an image loader with the given path (with width)', () => { const path = 'https://somesite.imgix.net'; const loader = createImgixLoader(path); const config = {src: 'img.png', width: 100}; @@ -261,7 +261,7 @@ describe('Built-in image directive loaders', () => { expect(loader({src: 'marketing/img-2.png'})).toBe(`${path}/marketing/img-2.png`); }); - it('should construct an image loader with the given path', () => { + it('should construct an image loader with the given path (with width)', () => { const path = 'https://ik.imageengine.io/imagetest'; const loader = createImageKitLoader(path); expect(loader({src: 'img.png', width: 100})).toBe(`${path}/tr:w-100/img.png`); @@ -357,7 +357,7 @@ describe('Built-in image directive loaders', () => { let config = {src: 'img.png'}; expect(loader(config)).toBe('https://mysite.com/cdn-cgi/image/format=auto/img.png'); }); - it('should construct an image loader with the given path', () => { + it('should construct an image loader with the given path (with width)', () => { const loader = createCloudflareLoader('https://mysite.com'); const config = {src: 'img.png', width: 100}; expect(loader(config)).toBe('https://mysite.com/cdn-cgi/image/format=auto,width=100/img.png'); @@ -446,7 +446,7 @@ describe('Built-in image directive loaders', () => { let config = {src: 'img.png'}; expect(loader(config)).toBe('https://mysite.com/.netlify/images?url=%2Fimg.png'); }); - it('should construct an image loader with the given path', () => { + it('should construct an image loader with the given path (with width)', () => { const loader = createNetlifyLoader('https://mysite.com'); const config = {src: 'img.png', width: 100}; expect(loader(config)).toBe('https://mysite.com/.netlify/images?url=%2Fimg.png&w=100'); diff --git a/packages/common/test/pipes/date_pipe_spec.ts b/packages/common/test/pipes/date_pipe_spec.ts index bc64539d6e6..86d1ec35399 100644 --- a/packages/common/test/pipes/date_pipe_spec.ts +++ b/packages/common/test/pipes/date_pipe_spec.ts @@ -6,11 +6,11 @@ * found in the LICENSE file at https://angular.dev/license */ +import {Component, ɵregisterLocaleData, ɵunregisterLocaleData} from '@angular/core'; +import {TestBed} from '@angular/core/testing'; import {DATE_PIPE_DEFAULT_OPTIONS, DatePipe} from '../../index'; import localeEn from '../../locales/en'; import localeEnExtra from '../../locales/extra/en'; -import {Component, ɵregisterLocaleData, ɵunregisterLocaleData} from '@angular/core'; -import {TestBed} from '@angular/core/testing'; describe('DatePipe', () => { const isoStringWithoutTime = '2015-01-01'; @@ -155,10 +155,6 @@ describe('DatePipe', () => { expect(pipe.transform('2017-01-11T00:00:00', 'mediumDate', '-1200')).toEqual('Jan 10, 2017'); }); - it('should take timezone into account with timezone offset', () => { - expect(pipe.transform('2017-01-11T00:00:00', 'mediumDate', '-1200')).toEqual('Jan 10, 2017'); - }); - it('should take the default timezone into account when no timezone is passed in', () => { pipe = new DatePipe('en-US', '-1200'); expect(pipe.transform('2017-01-11T00:00:00', 'mediumDate')).toEqual('Jan 10, 2017'); diff --git a/packages/common/test/pipes/keyvalue_pipe_spec.ts b/packages/common/test/pipes/keyvalue_pipe_spec.ts index 73015bfe975..cca2610ede2 100644 --- a/packages/common/test/pipes/keyvalue_pipe_spec.ts +++ b/packages/common/test/pipes/keyvalue_pipe_spec.ts @@ -6,11 +6,11 @@ * found in the LICENSE file at https://angular.dev/license */ +import {Component, ɵdefaultKeyValueDiffers as defaultKeyValueDiffers} from '@angular/core'; +import {TestBed} from '@angular/core/testing'; import {KeyValuePipe} from '../../index'; import {JsonPipe} from '../../public_api'; import {defaultComparator} from '../../src/pipes/keyvalue_pipe'; -import {Component, ɵdefaultKeyValueDiffers as defaultKeyValueDiffers} from '@angular/core'; -import {TestBed} from '@angular/core/testing'; describe('KeyValuePipe', () => { it('should return null when given null', () => { @@ -122,7 +122,7 @@ describe('KeyValuePipe', () => { expect(pipe.transform(myData, differ)?.length).toEqual(3); }); - it('should accept an nullable object with optional keys', () => { + it('should accept an nullable object with optional keys (null)', () => { interface MyInterface { one?: string; two?: string; @@ -134,7 +134,7 @@ describe('KeyValuePipe', () => { expect(pipe.transform(value)).toEqual(null); }); - it('should accept an nullable object with optional keys', () => { + it('should accept an nullable object with optional keys (non-null)', () => { interface MyInterface { one?: string; two?: string; diff --git a/packages/common/upgrade/test/upgrade.spec.ts b/packages/common/upgrade/test/upgrade.spec.ts index 25aed6bc330..b10b88d1691 100644 --- a/packages/common/upgrade/test/upgrade.spec.ts +++ b/packages/common/upgrade/test/upgrade.spec.ts @@ -6,9 +6,9 @@ * found in the LICENSE file at https://angular.dev/license */ -import {CommonModule, PathLocationStrategy} from '../../index'; import {inject, TestBed} from '@angular/core/testing'; import {UpgradeModule} from '@angular/upgrade/static'; +import {CommonModule} from '../../index'; import {$locationShim} from '../src/location_shim'; @@ -471,7 +471,7 @@ describe('NewUrl', function () { }); }); -describe('New URL Parsing', () => { +describe('New URL Parsing with appBaseHref', () => { let $location: $locationShim; let upgradeModule: UpgradeModule; diff --git a/packages/compiler-cli/linker/babel/test/ast/babel_ast_factory_spec.ts b/packages/compiler-cli/linker/babel/test/ast/babel_ast_factory_spec.ts index 196e5dbad62..de749ac9a2c 100644 --- a/packages/compiler-cli/linker/babel/test/ast/babel_ast_factory_spec.ts +++ b/packages/compiler-cli/linker/babel/test/ast/babel_ast_factory_spec.ts @@ -25,7 +25,7 @@ describe('BabelAstFactory', () => { beforeEach(() => (factory = new BabelAstFactory('/original.ts'))); describe('attachComments()', () => { - it('should add the comments to the given statement', () => { + it('should add the comments to the given statement (assignment)', () => { const stmt = statement.ast`x = 10;`; factory.attachComments(stmt, [ leadingComment('comment 1', true), diff --git a/packages/compiler-cli/src/ngtsc/file_system/testing/src/test_helper.ts b/packages/compiler-cli/src/ngtsc/file_system/testing/src/test_helper.ts index 24d13276ea6..386bab62a72 100644 --- a/packages/compiler-cli/src/ngtsc/file_system/testing/src/test_helper.ts +++ b/packages/compiler-cli/src/ngtsc/file_system/testing/src/test_helper.ts @@ -41,8 +41,12 @@ function runInEachFileSystemFn(callback: (os: string) => void) { FS_ALL.forEach((os) => runInFileSystem(os, callback, false)); } +// Jasmine require to have distinct top suite names. +// Since this function creates top level suites, we need to ensure that they have distinct names. +// We use a counter to ensure that each suite has a unique name, even if the same file system is tested multiple times. +let counter = 0; function runInFileSystem(os: string, callback: (os: string) => void, error: boolean) { - describe(`<>`, () => { + describe(`<>/${counter++}`, () => { beforeEach(() => initMockFileSystem(os)); afterEach(() => setFileSystem(new InvalidFileSystem())); callback(os); diff --git a/packages/compiler-cli/src/ngtsc/indexer/test/template_spec.ts b/packages/compiler-cli/src/ngtsc/indexer/test/template_spec.ts index 899ca38da45..5c16242da73 100644 --- a/packages/compiler-cli/src/ngtsc/indexer/test/template_spec.ts +++ b/packages/compiler-cli/src/ngtsc/indexer/test/template_spec.ts @@ -299,7 +299,7 @@ runInEachFileSystem(() => { ); }); - it('should discover properties in template expressions', () => { + it('should discover properties in structural directive', () => { const template = '
'; const refs = getTemplateIdentifiers(bind(template)); @@ -507,7 +507,7 @@ runInEachFileSystem(() => { ); }); - it('should discover references to references', () => { + it('should discover references used in an interpolation', () => { const template = `
{{foo.className}}
`; const refs = getTemplateIdentifiers(bind(template)); const elementIdentifier: ElementIdentifier = { @@ -592,7 +592,7 @@ runInEachFileSystem(() => { expect(fooRef.target!.directive).toEqual(declB); }); - it('should discover references to references', () => { + it('should discover references used in an event binding', () => { const template = `
`; const refs = getTemplateIdentifiers(bind(template)); const elementIdentifier: ElementIdentifier = { @@ -709,7 +709,7 @@ runInEachFileSystem(() => { ); }); - it('should discover references to variables', () => { + it('should discover references to variables used in an event binding', () => { const template = `
`; const refs = getTemplateIdentifiers(bind(template)); const variableIdentifier: VariableIdentifier = { diff --git a/packages/compiler-cli/src/ngtsc/translator/test/import_manager_spec.ts b/packages/compiler-cli/src/ngtsc/translator/test/import_manager_spec.ts index 26f432a921d..d0375e2d418 100644 --- a/packages/compiler-cli/src/ngtsc/translator/test/import_manager_spec.ts +++ b/packages/compiler-cli/src/ngtsc/translator/test/import_manager_spec.ts @@ -613,37 +613,6 @@ describe('import manager', () => { ); }); - it('should avoid collisions with generated identifiers', () => { - const {testFile, emit} = createTestProgram(``); - const manager = new ImportManager(); - - const inputRef = manager.addImport({ - exportModuleSpecifier: '@angular/core', - exportSymbolName: 'input', - requestedFile: testFile, - }); - - const inputRef2 = manager.addImport({ - exportModuleSpecifier: '@angular/core2', - exportSymbolName: 'input', - requestedFile: testFile, - }); - - const res = emit(manager, [ - ts.factory.createExpressionStatement(inputRef), - ts.factory.createExpressionStatement(inputRef2), - ]); - - expect(res).toBe( - omitLeadingWhitespace(` - import { input } from "@angular/core"; - import { input as input_1 } from "@angular/core2"; - input; - input_1; - `), - ); - }); - it('should re-use previous similar generated imports', () => { const {testFile, emit} = createTestProgram(``); const manager = new ImportManager(); diff --git a/packages/compiler-cli/src/ngtsc/typecheck/extended/test/checks/interpolated_signal_not_invoked/interpolated_signal_not_invoked_spec.ts b/packages/compiler-cli/src/ngtsc/typecheck/extended/test/checks/interpolated_signal_not_invoked/interpolated_signal_not_invoked_spec.ts index 406abb3cac6..342ea892d91 100644 --- a/packages/compiler-cli/src/ngtsc/typecheck/extended/test/checks/interpolated_signal_not_invoked/interpolated_signal_not_invoked_spec.ts +++ b/packages/compiler-cli/src/ngtsc/typecheck/extended/test/checks/interpolated_signal_not_invoked/interpolated_signal_not_invoked_spec.ts @@ -794,7 +794,7 @@ runInEachFileSystem(() => { expect(diags.length).toBe(0); }); - it('should not produce a warning with other Signal type', () => { + it('should not produce a warning when signal is an arg', () => { const fileName = absoluteFrom('/main.ts'); const {program, templateTypeChecker} = setup([ { @@ -921,7 +921,7 @@ runInEachFileSystem(() => { [false, true].forEach((negate) => { // Control flow - it(`should produce a warning when a property named '${functionInstanceProperty}' of a not invoked signal is used in an @if control flow expression`, () => { + it(`should produce a warning when a property named '${functionInstanceProperty}' of a not invoked signal is used in an @if control flow expression (negate=${negate})`, () => { const fileName = absoluteFrom('/main.ts'); const {program, templateTypeChecker} = setup([ { @@ -953,7 +953,7 @@ runInEachFileSystem(() => { expect(getSourceCodeForDiagnostic(diags[0])).toBe(`mySignal`); }); - it(`should not produce a warning when a property named '${functionInstanceProperty}' of an invoked signal is used in an @if control flow expression`, () => { + it(`should not produce a warning when a property named '${functionInstanceProperty}' of an invoked signal is used in an @if control flow expression (negate=${negate})`, () => { const fileName = absoluteFrom('/main.ts'); const {program, templateTypeChecker} = setup([ { @@ -982,7 +982,7 @@ runInEachFileSystem(() => { expect(diags.length).toBe(0); }); - it(`should produce a warning when a property named '${functionInstanceProperty}' of a not invoked signal is used in an @switch control flow expression`, () => { + it(`should produce a warning when a property named '${functionInstanceProperty}' of a not invoked signal is used in an @switch control flow (negate=${negate})`, () => { const fileName = absoluteFrom('/main.ts'); const {program, templateTypeChecker} = setup([ { @@ -1014,7 +1014,7 @@ runInEachFileSystem(() => { expect(getSourceCodeForDiagnostic(diags[0])).toBe(`mySignal`); }); - it(`should not produce a warning when a property named '${functionInstanceProperty}' of an invoked signal is used in an @switch control flow expression`, () => { + it(`should not produce a warning when a property named '${functionInstanceProperty}' of an invoked signal is used in an @switch control flow expression (negate=${negate})`, () => { const fileName = absoluteFrom('/main.ts'); const {program, templateTypeChecker} = setup([ { diff --git a/packages/compiler-cli/src/ngtsc/typecheck/extended/test/checks/uninvoked_function_in_event_binding/uninvoked_function_in_event_binding_spec.ts b/packages/compiler-cli/src/ngtsc/typecheck/extended/test/checks/uninvoked_function_in_event_binding/uninvoked_function_in_event_binding_spec.ts index 3c778889aaf..5287f76137f 100644 --- a/packages/compiler-cli/src/ngtsc/typecheck/extended/test/checks/uninvoked_function_in_event_binding/uninvoked_function_in_event_binding_spec.ts +++ b/packages/compiler-cli/src/ngtsc/typecheck/extended/test/checks/uninvoked_function_in_event_binding/uninvoked_function_in_event_binding_spec.ts @@ -88,7 +88,7 @@ runInEachFileSystem(() => { expect(diags[3].messageText).toBe(generateDiagnosticText('decrement()')); }); - it('should produce a diagnostic when a function in a conditional is not invoked', () => { + it('should produce a diagnostic when no function in a conditional is not invoked', () => { const diags = setupTestComponent( ``, `increment() { } decrement() { }`, @@ -101,7 +101,7 @@ runInEachFileSystem(() => { expect(diags[1].messageText).toBe(generateDiagnosticText('decrement()')); }); - it('should produce a diagnostic when a function in a conditional is not invoked', () => { + it('should produce a diagnostic when a function is not', () => { const diags = setupTestComponent( ``, `increment() { } decrement() { }`, diff --git a/packages/compiler-cli/src/ngtsc/typecheck/extended/test/checks/unparenthesized_nullish_coalescing/unparenthesized_nullish_coalescing_spec.ts b/packages/compiler-cli/src/ngtsc/typecheck/extended/test/checks/unparenthesized_nullish_coalescing/unparenthesized_nullish_coalescing_spec.ts index fc1e0201c93..8b2d72cb689 100644 --- a/packages/compiler-cli/src/ngtsc/typecheck/extended/test/checks/unparenthesized_nullish_coalescing/unparenthesized_nullish_coalescing_spec.ts +++ b/packages/compiler-cli/src/ngtsc/typecheck/extended/test/checks/unparenthesized_nullish_coalescing/unparenthesized_nullish_coalescing_spec.ts @@ -6,8 +6,8 @@ * found in the LICENSE file at https://angular.dev/license */ -import {DiagnosticCategoryLabel} from '../../../../../core/api'; import ts from 'typescript'; +import {DiagnosticCategoryLabel} from '../../../../../core/api'; import {ErrorCode, ExtendedTemplateDiagnosticName, ngErrorCode} from '../../../../../diagnostics'; import {absoluteFrom, getSourceFileOrError} from '../../../../../file_system'; import {runInEachFileSystem} from '../../../../../file_system/testing'; @@ -102,7 +102,7 @@ runInEachFileSystem(() => { expect(diags.length).toBe(0); }); - it('should produce warning when mixing nullish coalescing with logical or', () => { + it('should produce warning when mixing nullish coalescing with logical or (with parenthesis)', () => { const fileName = absoluteFrom('/main.ts'); const {program, templateTypeChecker} = setup([ { diff --git a/packages/compiler-cli/src/ngtsc/typecheck/extended/test/checks/unused_let_declaration/unused_let_declaration_spec.ts b/packages/compiler-cli/src/ngtsc/typecheck/extended/test/checks/unused_let_declaration/unused_let_declaration_spec.ts index f79eb127ba3..9d27c2a4c83 100644 --- a/packages/compiler-cli/src/ngtsc/typecheck/extended/test/checks/unused_let_declaration/unused_let_declaration_spec.ts +++ b/packages/compiler-cli/src/ngtsc/typecheck/extended/test/checks/unused_let_declaration/unused_let_declaration_spec.ts @@ -51,7 +51,7 @@ runInEachFileSystem(() => { ); }); - it('should report a @let declaration that is not used', () => { + it('should report a @let declaration that is not used (with other @let declarations)', () => { const diags = diagnose(` @let used = 1; @let unused = 2; @@ -64,7 +64,7 @@ runInEachFileSystem(() => { expect(getSourceCodeForDiagnostic(diags[0])).toBe('@let unused = 2'); }); - it('should report a @let declaration that is not used', () => { + it('should report a solo @let declaration that is not used', () => { const diags = diagnose(` @let foo = 1; diff --git a/packages/compiler-cli/test/compliance/test_helpers/test_runner.ts b/packages/compiler-cli/test/compliance/test_helpers/test_runner.ts index 5cb37b573be..20445e92922 100644 --- a/packages/compiler-cli/test/compliance/test_helpers/test_runner.ts +++ b/packages/compiler-cli/test/compliance/test_helpers/test_runner.ts @@ -55,6 +55,7 @@ export function runTests( } = {}, ) { describe(`compliance tests (${type})`, () => { + let counter = 0; for (const test of getAllComplianceTests()) { if (!test.compilationModeFilter.includes(type)) { continue; @@ -63,7 +64,7 @@ export function runTests( continue; } - describe(`[${test.relativePath}]`, () => { + describe(`[${test.relativePath}]/${counter++}`, () => { const itFn = test.focusTest ? fit : test.excludeTest ? xit : it; itFn(test.description, () => { if (type === 'linked compile' && test.compilerOptions?.['target'] === 'ES5') { diff --git a/packages/compiler-cli/test/ngtsc/doc_extraction/class_doc_extraction_spec.ts b/packages/compiler-cli/test/ngtsc/doc_extraction/class_doc_extraction_spec.ts index d74c22f279d..26596a7dbfe 100644 --- a/packages/compiler-cli/test/ngtsc/doc_extraction/class_doc_extraction_spec.ts +++ b/packages/compiler-cli/test/ngtsc/doc_extraction/class_doc_extraction_spec.ts @@ -322,7 +322,7 @@ runInEachFileSystem(() => { expect(getBirthdayMember.memberTags).toContain(MemberTags.Optional); }); - it('should extract member tags', () => { + it('should not extract internal member tags', () => { // Test both properties and methods with zero, one, and multiple tags. env.write( 'index.ts', diff --git a/packages/compiler-cli/test/ngtsc/hmr_spec.ts b/packages/compiler-cli/test/ngtsc/hmr_spec.ts index 4965911a98e..dab0b558509 100644 --- a/packages/compiler-cli/test/ngtsc/hmr_spec.ts +++ b/packages/compiler-cli/test/ngtsc/hmr_spec.ts @@ -6,13 +6,13 @@ * found in the LICENSE file at https://angular.dev/license */ +import ts from 'typescript'; import {runInEachFileSystem} from '../../src/ngtsc/file_system/testing'; +import {NgtscProgram} from '../../src/ngtsc/program'; import {loadStandardTestFiles} from '../../src/ngtsc/testing'; -import {NgtscTestEnvironment} from './env'; import {CompilerOptions} from '../../src/transformers/api'; import {createCompilerHost} from '../../src/transformers/compiler_host'; -import {NgtscProgram} from '../../src/ngtsc/program'; -import ts from 'typescript'; +import {NgtscTestEnvironment} from './env'; runInEachFileSystem(() => { describe('HMR code generation', () => { @@ -994,7 +994,7 @@ runInEachFileSystem(() => { expect(hmrContents).toContain('export default function Cmp_UpdateMetadata'); }); - it('should generate an HMR initializer and update function for a class that depends on multiple namespaces', () => { + it('should generate an HMR initializer and update function for a class with NodeNext', () => { enableHmr(undefined, { compilerOptions: { module: 'NodeNext', diff --git a/packages/compiler-cli/test/ngtsc/ngtsc_spec.ts b/packages/compiler-cli/test/ngtsc/ngtsc_spec.ts index 3a22d6870eb..22d6b43d90d 100644 --- a/packages/compiler-cli/test/ngtsc/ngtsc_spec.ts +++ b/packages/compiler-cli/test/ngtsc/ngtsc_spec.ts @@ -6,11 +6,11 @@ * found in the LICENSE file at https://angular.dev/license */ +import {platform} from 'node:os'; +import ts from 'typescript'; import {NgtscProgram} from '../../src/ngtsc/program'; import {CompilerOptions} from '../../src/transformers/api'; import {createCompilerHost} from '../../src/transformers/compiler_host'; -import {platform} from 'node:os'; -import ts from 'typescript'; import {ErrorCode, ngErrorCode} from '../../src/ngtsc/diagnostics'; import {absoluteFrom} from '../../src/ngtsc/file_system'; @@ -7326,8 +7326,8 @@ runInEachFileSystem((os: string) => { `, ]; - cases.forEach((template) => { - it('should not throw', () => { + cases.forEach((template, index) => { + it(`should not throw [id=${index}]`, () => { env.write('test.ts', getComponentScript(template)); const errors = env.driveDiagnostics(); expect(errors.length).toBe(0); @@ -7641,7 +7641,7 @@ runInEachFileSystem((os: string) => { expect(diags[1].messageText).toBe('NgModule "import" field contains a cycle'); }); - it('should report if an NgModule imports itself via a forwardRef', () => { + it('should report if an NgModule imports itself via a forwardRef (nested)', () => { env.write( 'test.ts', ` diff --git a/packages/compiler-cli/test/ngtsc/template_typecheck_spec.ts b/packages/compiler-cli/test/ngtsc/template_typecheck_spec.ts index 7f806c1e9d2..c8a72403dc1 100644 --- a/packages/compiler-cli/test/ngtsc/template_typecheck_spec.ts +++ b/packages/compiler-cli/test/ngtsc/template_typecheck_spec.ts @@ -4741,7 +4741,7 @@ suppress ); }); - it('should check bindings to inherited host directive inputs', () => { + it('should check bindings to inherited host directive inputs 2', () => { env.write( 'test.ts', ` @@ -4792,7 +4792,7 @@ suppress ]); }); - it('should check bindings to inherited host directive outputs', () => { + it('should check bindings to inherited host directive outputs 2', () => { env.write( 'test.ts', ` diff --git a/packages/compiler-cli/test/ngtsc/xi18n_spec.ts b/packages/compiler-cli/test/ngtsc/xi18n_spec.ts index 84579c34922..7251fba2afc 100644 --- a/packages/compiler-cli/test/ngtsc/xi18n_spec.ts +++ b/packages/compiler-cli/test/ngtsc/xi18n_spec.ts @@ -6,9 +6,9 @@ * found in the LICENSE file at https://angular.dev/license */ +import {platform} from 'node:os'; import {runInEachFileSystem} from '../../src/ngtsc/file_system/testing'; import {loadStandardTestFiles} from '../../src/ngtsc/testing'; -import {platform} from 'node:os'; import {NgtscTestEnvironment} from './env'; @@ -44,7 +44,7 @@ runInEachFileSystem((os) => { expect(env.getContents('messages.xlf')).toEqual(EXPECTED_XLIFF); }); - it('should extract xlf', () => { + it('should extract xlf2', () => { env.driveXi18n('xlf2', 'messages.xliff2.xlf'); expect(env.getContents('messages.xliff2.xlf')).toEqual(EXPECTED_XLIFF2); }); diff --git a/packages/compiler/test/expression_parser/parser_spec.ts b/packages/compiler/test/expression_parser/parser_spec.ts index 86ac58fd0cd..5ddf5a5fadb 100644 --- a/packages/compiler/test/expression_parser/parser_spec.ts +++ b/packages/compiler/test/expression_parser/parser_spec.ts @@ -1125,10 +1125,6 @@ describe('parser', () => { expectBindingError('a) => a + 1', "Unexpected token ')'"); }); - it('should report missing comma between arrow function parameters', () => { - expectBindingError('(a b) => a + b', 'Missing expected ,'); - }); - it('should report an error inside the arrow function expression', () => { expectBindingError('(a) => a. + 1', 'Unexpected token +, expected identifier or keyword'); }); diff --git a/packages/compiler/test/i18n/extractor_merger_spec.ts b/packages/compiler/test/i18n/extractor_merger_spec.ts index fde4dc6ef13..096752c21a9 100644 --- a/packages/compiler/test/i18n/extractor_merger_spec.ts +++ b/packages/compiler/test/i18n/extractor_merger_spec.ts @@ -6,8 +6,8 @@ * found in the LICENSE file at https://angular.dev/license */ -import {HtmlParser} from '../../index'; import {MissingTranslationStrategy} from '@angular/core'; +import {HtmlParser} from '../../index'; import {digest, serializeNodes as serializeI18nNodes} from '../../src/i18n/digest'; import {extractMessages, mergeTranslations} from '../../src/i18n/extractor_merger'; @@ -337,7 +337,7 @@ describe('Extractor', () => { ]); }); - it('should ignore implicit elements in non translatable ICU messages', () => { + it('should ignore implicit elements in non translatable ICU messages 2', () => { expect(extract('{count, plural, =0 { {sex, select, male {

ignore

}} }}', ['p'])).toEqual( [], ); diff --git a/packages/compiler/test/i18n/integration_xliff2_spec.ts b/packages/compiler/test/i18n/integration_xliff2_spec.ts index 89ee520fd84..84162b81ce7 100644 --- a/packages/compiler/test/i18n/integration_xliff2_spec.ts +++ b/packages/compiler/test/i18n/integration_xliff2_spec.ts @@ -6,8 +6,8 @@ * found in the LICENSE file at https://angular.dev/license */ -import {Xliff2} from '../../src/i18n/serializers/xliff2'; import {expect} from '@angular/private/testing/matchers'; +import {Xliff2} from '../../src/i18n/serializers/xliff2'; import { configureCompiler, @@ -18,7 +18,7 @@ import { } from './integration_common'; // TODO(alxhub): figure out if this test is still relevant. -xdescribe('i18n XLIFF integration spec', () => { +xdescribe('i18n XLIFF2 integration spec', () => { describe('(with LF line endings)', () => { beforeEach(() => configureCompiler(XLIFF2_TOMERGE + LF_LINE_ENDING_XLIFF2_TOMERGE, 'xlf2')); diff --git a/packages/compiler/test/ml_parser/html_parser_spec.ts b/packages/compiler/test/ml_parser/html_parser_spec.ts index 0459a87be0a..a0c0313ade5 100644 --- a/packages/compiler/test/ml_parser/html_parser_spec.ts +++ b/packages/compiler/test/ml_parser/html_parser_spec.ts @@ -358,35 +358,6 @@ describe('HtmlParser', () => { ]); }); - it('should parse attributes containing unquoted interpolation', () => { - expect(humanizeDom(parser.parse('
', 'TestComp'))).toEqual([ - [html.Element, 'div', 0], - [html.Attribute, 'foo', '{{message}}', [''], ['{{', 'message', '}}'], ['']], - ]); - }); - - it('should parse bound inputs with expressions containing newlines', () => { - expect( - humanizeDom( - parser.parse( - `` + - ``, - 'TestComp', - ), - ), - ).toEqual([ - [html.Element, 'app-component', 0], - [ - html.Attribute, - '[attr]', - `[\n {text: 'some text',url:'//www.google.com'},\n {text:'other text',url:'//www.google.com'}]`, - [ - `[\n {text: 'some text',url:'//www.google.com'},\n {text:'other text',url:'//www.google.com'}]`, - ], - ], - ]); - }); - it('should decode HTML entities in interpolated attributes', () => { // Note that the detail of decoding corner-cases is tested in the // "should decode HTML entities in interpolations" spec. @@ -586,7 +557,7 @@ describe('HtmlParser', () => { }); describe('expansion forms', () => { - it('should parse out expansion forms', () => { + it('should parse out expansion forms (with multiple cases)', () => { const parsed = parser.parse( `
before{messages.length, plural, =0 {You have no messages} =1 {One {{message}}}}after
`, 'TestComp', @@ -725,7 +696,7 @@ describe('HtmlParser', () => { expect(parsed.errors).toEqual([]); }); - it('should not normalize line-endings in ICU expressions in external templates when `i18nNormalizeLineEndingsInICUs` is not set', () => { + it('should not normalize line-endings in ICU expressions in external templates when `i18nNormalizeLineEndingsInICUs` is not set (escapedString:false)', () => { const parsed = parser.parse( `
\r\n` + ` {\r\n` + @@ -1243,7 +1214,7 @@ describe('HtmlParser', () => { ]); }); - it('should parse an incomplete block with no parameters', () => { + it('should parse an incomplete block with no body', () => { const result = parser.parse( 'This is the @if({alias: "foo"}) block with params', 'TestComp', diff --git a/packages/compiler/test/ml_parser/lexer_spec.ts b/packages/compiler/test/ml_parser/lexer_spec.ts index bc57f2d8c61..91ebdd3c1b1 100644 --- a/packages/compiler/test/ml_parser/lexer_spec.ts +++ b/packages/compiler/test/ml_parser/lexer_spec.ts @@ -971,7 +971,7 @@ describe('HtmlLexer', () => { expect(result.nonNormalizedIcuExpressions).toEqual([]); }); - it('should not normalize line-endings in ICU expressions when `i18nNormalizeLineEndingsInICUs` is not defined', () => { + it('should not normalize line-endings in ICU expressions when `i18nNormalizeLineEndingsInICUs` is not defined (escapedString:false)', () => { const result = tokenizeWithoutErrors( `{\r\n` + ` messages.length,\r\n` + @@ -1856,28 +1856,6 @@ describe('HtmlLexer', () => { ]); }); - it('should parse bound inputs with expressions containing newlines', () => { - expect( - tokenizeAndHumanizeParts(``), - ).toEqual([ - [TokenType.TAG_OPEN_START, '', 'app-component'], - [TokenType.ATTR_NAME, '', '[attr]'], - [TokenType.ATTR_QUOTE, '"'], - [ - TokenType.ATTR_VALUE_TEXT, - '[\n' + - " {text: 'some text',url:'//www.google.com'},\n" + - " {text:'other text',url:'//www.google.com'}]", - ], - [TokenType.ATTR_QUOTE, '"'], - [TokenType.TAG_OPEN_END], - [TokenType.EOF], - ]); - }); - it('should allow whitespace', () => { expect(tokenizeAndHumanizeParts('')).toEqual([ [TokenType.TAG_OPEN_START, '', 't'], @@ -2906,7 +2884,7 @@ describe('HtmlLexer', () => { expect(result.nonNormalizedIcuExpressions).toEqual([]); }); - it('should not normalize line-endings in ICU expressions when `i18nNormalizeLineEndingsInICUs` is not defined', () => { + it('should not normalize line-endings in ICU expressions when `i18nNormalizeLineEndingsInICUs` is not defined (escapeString: false)', () => { const result = tokenizeWithoutErrors( `{\r\n` + ` messages.length,\r\n` + diff --git a/packages/compiler/test/output/abstract_emitter_node_only_spec.ts b/packages/compiler/test/output/abstract_emitter_node_only_spec.ts index 7392b215cca..03c8757be4f 100644 --- a/packages/compiler/test/output/abstract_emitter_node_only_spec.ts +++ b/packages/compiler/test/output/abstract_emitter_node_only_spec.ts @@ -11,7 +11,7 @@ import {EmitterVisitorContext} from '../../src/output/abstract_emitter'; import {originalPositionFor} from './source_map_util'; -describe('AbstractEmitter', () => { +describe('AbstractEmitter (node only)', () => { describe('EmitterVisitorContext', () => { const fileA = new ParseSourceFile('a0a1a2a3a4a5a6a7a8a9', 'a.js'); const fileB = new ParseSourceFile('b0b1b2b3b4b5b6b7b8b9', 'b.js'); diff --git a/packages/compiler/test/render3/r3_ast_absolute_span_spec.ts b/packages/compiler/test/render3/r3_ast_absolute_span_spec.ts index ef649ece1be..5159e524313 100644 --- a/packages/compiler/test/render3/r3_ast_absolute_span_spec.ts +++ b/packages/compiler/test/render3/r3_ast_absolute_span_spec.ts @@ -462,7 +462,7 @@ describe('expression AST absolute source spans', () => { expect(spans).toContain(['item.placeholder', new AbsoluteSourceSpan(40, 56)]); }); - it('is correct for variables and placeholders', () => { + it('is correct for variables and placeholders in nested ICUs', () => { const spans = humanizeExpressionSource( parse( '{item.var, plural, other { {{item.placeholder}} {nestedVar, plural, other { {{nestedPlaceholder}} }}} }', diff --git a/packages/core/schematics/migrations/signal-queries-migration/migration.spec.ts b/packages/core/schematics/migrations/signal-queries-migration/migration.spec.ts index 6dd3919aaa0..32873bbbcad 100644 --- a/packages/core/schematics/migrations/signal-queries-migration/migration.spec.ts +++ b/packages/core/schematics/migrations/signal-queries-migration/migration.spec.ts @@ -91,11 +91,6 @@ const declarationTestCases: TestCase[] = [ before: `@ContentChild('myBtn', {read: ElementRef}) buttonEl!: ElementRef;`, after: `readonly buttonEl = contentChild.required('myBtn', { read: ElementRef });`, }, - { - id: 'contentChild with string locator and read option, required', - before: `@ContentChild('myBtn', {read: ElementRef}) buttonEl!: ElementRef;`, - after: `readonly buttonEl = contentChild.required('myBtn', { read: ElementRef });`, - }, { id: 'contentChild with descendants option', before: `@ContentChild('myBtn', {descendants: false}) buttonEl!: ElementRef;`, @@ -118,7 +113,7 @@ const declarationTestCases: TestCase[] = [ after: `readonly button = viewChildren(MyButton);`, }, { - id: 'viewChild with string locator and read option, nullable shorthand', + id: 'viewChildren with string locator and read option, nullable shorthand', before: `@ViewChildren('myBtn', {read: ElementRef}) buttonEl?: QueryList;`, after: `readonly buttonEl = viewChildren('myBtn', { read: ElementRef });`, }, @@ -200,7 +195,7 @@ const declarationTestCases: TestCase[] = [ after: `readonly buttonEl = contentChild('myBtn', { read: ButtonEl });`, }, { - id: 'query with explicit ReadT', + id: 'query with explicit read ElementRef', before: `@ContentChild(SomeDir, {read: ElementRef}) buttonEl!: ElementRef`, after: `readonly buttonEl = contentChild.required(SomeDir, { read: ElementRef });`, }, diff --git a/packages/core/schematics/test/control_flow_migration_spec.ts b/packages/core/schematics/test/control_flow_migration_spec.ts index 1854f243ecd..1af3f73a908 100644 --- a/packages/core/schematics/test/control_flow_migration_spec.ts +++ b/packages/core/schematics/test/control_flow_migration_spec.ts @@ -10,8 +10,8 @@ import {getSystemPath, logging, normalize, virtualFs} from '@angular-devkit/core import {TempScopedNodeJsSyncHost} from '@angular-devkit/core/node/testing'; import {HostTree} from '@angular-devkit/schematics'; import {SchematicTestRunner, UnitTestTree} from '@angular-devkit/schematics/testing/index.js'; -import {resolve} from 'path'; import {rmSync} from 'node:fs'; +import {resolve} from 'path'; describe('control flow migration (ng update)', () => { let runner: SchematicTestRunner; @@ -1786,32 +1786,6 @@ describe('control flow migration (ng update)', () => { 'template: `
@if (toggle) {This should be hidden}
`', ); }); - - it('should migrate a nested class', async () => { - writeFile( - '/comp.ts', - ` - import {Component} from '@angular/core'; - import {NgIf} from '@angular/common'; - function foo() { - @Component({ - imports: [NgIf], - template: \`
This should be hidden
\` - }) - class Comp { - toggle = false; - } - } - `, - ); - - await runMigration(); - const content = tree.readContent('/comp.ts'); - - expect(content).toContain( - 'template: `
@if (toggle) {This should be hidden}
`', - ); - }); }); describe('ngFor', () => { @@ -2437,36 +2411,6 @@ describe('control flow migration (ng update)', () => { ); }); - it('should migrate a nested class', async () => { - writeFile( - '/comp.ts', - ` - import {Component} from '@angular/core'; - import {NgFor} from '@angular/common'; - interface Item { - id: number; - text: string; - } - function foo() { - @Component({ - imports: [NgFor], - template: \`
  • {{item.text}}
\` - }) - class Comp { - items: Item[] = [{id: 1, text: 'blah'},{id: 2, text: 'stuff'}]; - } - } - `, - ); - - await runMigration(); - const content = tree.readContent('/comp.ts'); - - expect(content).toContain( - 'template: `
    @for (item of items; track item) {
  • {{item.text}}
  • }
`', - ); - }); - it('should migrate an ngFor with quoted semicolon in expression', async () => { writeFile( '/comp.ts', @@ -2490,29 +2434,6 @@ describe('control flow migration (ng update)', () => { ); }); - it('should migrate an ngFor with quoted semicolon in expression', async () => { - writeFile( - '/comp.ts', - ` - import {Component} from '@angular/core'; - import {NgFor} from '@angular/common'; - - @Component({ - imports: [NgFor], - template: \`
  • {{itm}}
\` - }) - class Comp {} - `, - ); - - await runMigration(); - const content = tree.readContent('/comp.ts'); - - expect(content).toContain( - "template: `
    @for (itm of '1,2,3'; track itm) {
  • {{itm}}
  • }
`", - ); - }); - it('should migrate ngForTemplate', async () => { writeFile( '/comp.ts', @@ -3410,57 +3331,6 @@ describe('control flow migration (ng update)', () => { ); }); - it('should migrate an inline template with multiple nested control flow structures', async () => { - writeFile( - '/comp.ts', - ` - import {Component} from '@angular/core'; - import {NgIf} from '@angular/common'; - - @Component({ - imports: [NgFor, NgIf], - templateUrl: './comp.html' - }) - class Comp { - show = false; - nest = true; - again = true; - more = true; - } - `, - ); - - writeFile( - '/comp.html', - [ - `
`, - `things`, - `
`, - `stuff`, - `
`, - `
`, - ].join('\n'), - ); - - await runMigration(); - const content = tree.readContent('/comp.html'); - - expect(content).toBe( - [ - `@if (show) {`, - `
`, - ` things`, - ` @if (nest) {`, - `
`, - ` stuff`, - `
`, - ` }`, - `
`, - `}`, - ].join('\n'), - ); - }); - it('should migrate a simple nested case', async () => { writeFile( '/comp.ts', @@ -4234,97 +4104,6 @@ describe('control flow migration (ng update)', () => { }); }); - describe('error handling', () => { - it('should log template migration errors to the console', async () => { - writeFile( - '/comp.ts', - ` - import {Component} from '@angular/core'; - import {NgIf} from '@angular/common'; - - @Component({ - imports: [NgIf], - template: \`
This should be hidden
\` - }) - class Comp { - toggle = false; - } - `, - ); - - await runMigration(); - tree.readContent('/comp.ts'); - }); - - it('should log a migration error when duplicate ng-template names are detected', async () => { - writeFile( - '/comp.ts', - ` - import {Component} from '@angular/core'; - import {NgIf} from '@angular/common'; - - @Component({ - imports: [NgIf], - templateUrl: './comp.html' - }) - class Comp { - toggle = false; - } - `, - ); - - writeFile( - './comp.html', - [ - `
Content
`, - `
Content
`, - `Else Content`, - `Duplicate`, - ].join('\n'), - ); - - await runMigration(); - tree.readContent('/comp.ts'); - - expect(warnOutput.join(' ')).toContain( - `A duplicate ng-template name "#elseTmpl" was found. ` + - `The control flow migration requires unique ng-template names within a component.`, - ); - }); - - it('should log a migration error when collection aliasing is detected in ngFor', async () => { - writeFile( - '/comp.ts', - ` - import {Component} from '@angular/core'; - import {NgIf} from '@angular/common'; - - @Component({ - imports: [NgIf], - templateUrl: './comp.html' - }) - class Comp { - toggle = false; - } - `, - ); - - writeFile( - './comp.html', - [`
Content
`].join('\n'), - ); - - await runMigration(); - tree.readContent('/comp.ts'); - - expect(warnOutput.join(' ')).toContain( - `Found an aliased collection on an ngFor: "item of list$ | async as list". ` + - `Collection aliasing is not supported with @for. ` + - `Refactor the code to remove the \`as\` alias and re-run the migration.`, - ); - }); - }); - describe('template', () => { it('should migrate a root level template thats not used in control flow', async () => { writeFile( @@ -6688,6 +6467,95 @@ describe('control flow migration (ng update)', () => { }); describe('error handling', () => { + it('should log template migration errors to the console', async () => { + writeFile( + '/comp.ts', + ` + import {Component} from '@angular/core'; + import {NgIf} from '@angular/common'; + + @Component({ + imports: [NgIf], + template: \`
This should be hidden
\` + }) + class Comp { + toggle = false; + } + `, + ); + + await runMigration(); + tree.readContent('/comp.ts'); + }); + + it('should log a migration error when duplicate ng-template names are detected', async () => { + writeFile( + '/comp.ts', + ` + import {Component} from '@angular/core'; + import {NgIf} from '@angular/common'; + + @Component({ + imports: [NgIf], + templateUrl: './comp.html' + }) + class Comp { + toggle = false; + } + `, + ); + + writeFile( + './comp.html', + [ + `
Content
`, + `
Content
`, + `Else Content`, + `Duplicate`, + ].join('\n'), + ); + + await runMigration(); + tree.readContent('/comp.ts'); + + expect(warnOutput.join(' ')).toContain( + `A duplicate ng-template name "#elseTmpl" was found. ` + + `The control flow migration requires unique ng-template names within a component.`, + ); + }); + + it('should log a migration error when collection aliasing is detected in ngFor', async () => { + writeFile( + '/comp.ts', + ` + import {Component} from '@angular/core'; + import {NgIf} from '@angular/common'; + + @Component({ + imports: [NgIf], + templateUrl: './comp.html' + }) + class Comp { + toggle = false; + } + `, + ); + + writeFile( + './comp.html', + [`
Content
`].join('\n'), + ); + + await runMigration(); + tree.readContent('/comp.ts'); + + expect(warnOutput.join(' ')).toContain( + `Found an aliased collection on an ngFor: "item of list$ | async as list". ` + + `Collection aliasing is not supported with @for. ` + + `Refactor the code to remove the \`as\` alias and re-run the migration.`, + ); + }); + it('should not migrate a template that would result in invalid html', async () => { writeFile( '/comp.ts', diff --git a/packages/core/schematics/test/inject_migration_spec.ts b/packages/core/schematics/test/inject_migration_spec.ts index d66c29191ac..d0ece6c09d9 100644 --- a/packages/core/schematics/test/inject_migration_spec.ts +++ b/packages/core/schematics/test/inject_migration_spec.ts @@ -10,8 +10,8 @@ import {getSystemPath, normalize, virtualFs} from '@angular-devkit/core'; import {TempScopedNodeJsSyncHost} from '@angular-devkit/core/node/testing'; import {HostTree} from '@angular-devkit/schematics'; import {SchematicTestRunner, UnitTestTree} from '@angular-devkit/schematics/testing/index.js'; -import {resolve} from 'node:path'; import {rmSync} from 'node:fs'; +import {resolve} from 'node:path'; describe('inject migration', () => { let runner: SchematicTestRunner; @@ -334,33 +334,6 @@ describe('inject migration', () => { ]); }); - it('should migrate an aliased decorator to use inject()', async () => { - writeFile( - '/dir.ts', - [ - `import { Directive as NgDirective } from '@angular/core';`, - `import { Foo } from 'foo';`, - ``, - `@NgDirective()`, - `class MyDir {`, - ` constructor(private foo: Foo) {}`, - `}`, - ].join('\n'), - ); - - await runMigration(); - - expect(tree.readContent('/dir.ts').split('\n')).toEqual([ - `import { Directive as NgDirective, inject } from '@angular/core';`, - `import { Foo } from 'foo';`, - ``, - `@NgDirective()`, - `class MyDir {`, - ` private foo = inject(Foo);`, - `}`, - ]); - }); - it('should only migrate classes in the specified directory', async () => { writeFile( '/should-migrate/dir.ts', diff --git a/packages/core/schematics/test/standalone_migration_spec.ts b/packages/core/schematics/test/standalone_migration_spec.ts index 5c0e234b554..a3d6d15640d 100644 --- a/packages/core/schematics/test/standalone_migration_spec.ts +++ b/packages/core/schematics/test/standalone_migration_spec.ts @@ -10,8 +10,8 @@ import {getSystemPath, normalize, virtualFs} from '@angular-devkit/core'; import {TempScopedNodeJsSyncHost} from '@angular-devkit/core/node/testing'; import {HostTree} from '@angular-devkit/schematics'; import {SchematicTestRunner, UnitTestTree} from '@angular-devkit/schematics/testing/index.js'; -import {resolve} from 'node:path'; import {rmSync} from 'node:fs'; +import {resolve} from 'node:path'; describe('standalone migration', () => { let runner: SchematicTestRunner; @@ -887,76 +887,6 @@ describe('standalone migration', () => { ); }); - it('should add imports to dependencies within the same module', async () => { - writeFile( - 'module.ts', - ` - import {NgModule} from '@angular/core'; - import {MyComp} from './comp'; - import {MyButton} from './button'; - import {MyTooltip} from './tooltip'; - - @NgModule({declarations: [MyComp, MyButton, MyTooltip], exports: [MyComp]}) - export class Mod {} - `, - ); - - writeFile( - 'comp.ts', - ` - import {Component} from '@angular/core'; - - @Component({selector: 'my-comp', template: 'Hello', standalone: false}) - export class MyComp {} - `, - ); - - writeFile( - 'button.ts', - ` - import {Component} from '@angular/core'; - - @Component({selector: 'my-button', template: '', standalone: false}) - export class MyButton {} - `, - ); - - writeFile( - 'tooltip.ts', - ` - import {Directive} from '@angular/core'; - - @Directive({selector: '[tooltip]', standalone: false}) - export class MyTooltip {} - `, - ); - - await runMigration('convert-to-standalone'); - - const myCompContent = tree.readContent('comp.ts'); - - expect(myCompContent).toContain(`import { MyButton } from './button';`); - expect(myCompContent).toContain(`import { MyTooltip } from './tooltip';`); - expect(stripWhitespace(myCompContent)).toContain( - stripWhitespace(` - @Component({ - selector: 'my-comp', - template: 'Hello', - imports: [MyButton, MyTooltip] - }) - `), - ); - expect(stripWhitespace(tree.readContent('module.ts'))).toContain( - stripWhitespace(`@NgModule({imports: [MyComp, MyButton, MyTooltip], exports: [MyComp]})`), - ); - expect(stripWhitespace(tree.readContent('button.ts'))).toContain( - stripWhitespace(`@Component({selector: 'my-button', template: ''})`), - ); - expect(stripWhitespace(tree.readContent('tooltip.ts'))).toContain( - stripWhitespace(`@Directive({selector: '[tooltip]'})`), - ); - }); - it('should add imports to external dependencies', async () => { writeFile( 'module.ts', diff --git a/packages/core/test/acceptance/common_integration_spec.ts b/packages/core/test/acceptance/common_integration_spec.ts index 90a2b6de892..30ce0c9f0b9 100644 --- a/packages/core/test/acceptance/common_integration_spec.ts +++ b/packages/core/test/acceptance/common_integration_spec.ts @@ -6,9 +6,9 @@ * found in the LICENSE file at https://angular.dev/license */ +import {By} from '@angular/platform-browser'; import {Component, Directive, provideZoneChangeDetection} from '../../src/core'; import {TestBed} from '../../testing'; -import {By} from '@angular/platform-browser'; describe('@angular/common integration', () => { beforeEach(() => { @@ -571,7 +571,7 @@ describe('@angular/common integration', () => { }); describe('NgTemplateOutlet', () => { - it('should create and remove embedded views', () => { + it('should create and remove embedded views (ng-template)', () => { @Component({ selector: 'app-multi', template: `from tpl @@ -597,7 +597,7 @@ describe('@angular/common integration', () => { expect(fixture.nativeElement.textContent).not.toBe('from tpl'); }); - it('should create and remove embedded views', () => { + it('should create and remove embedded views (ng-container)', () => { @Component({ selector: 'app-multi', template: `from tpl diff --git a/packages/core/test/acceptance/component_spec.ts b/packages/core/test/acceptance/component_spec.ts index 708637463f8..63e08199eae 100644 --- a/packages/core/test/acceptance/component_spec.ts +++ b/packages/core/test/acceptance/component_spec.ts @@ -7,6 +7,7 @@ */ import {DOCUMENT, NgIf} from '@angular/common'; +import {expect} from '@angular/private/testing/matchers'; import { ApplicationRef, Component, @@ -35,7 +36,6 @@ import { ɵɵdefineComponent, } from '../../src/core'; import {TestBed} from '../../testing'; -import {expect} from '@angular/private/testing/matchers'; import {global} from '../../src/util/global'; @@ -84,6 +84,41 @@ describe('component', () => { expect(destroyCalls).toBe(1, 'Expected `ngOnDestroy` to only be called once.'); }); + + it('should invoke onDestroy when directly destroying a root view', () => { + let wasOnDestroyCalled = false; + + @Component({ + selector: 'comp-with-destroy', + template: ``, + standalone: false, + }) + class ComponentWithOnDestroy implements OnDestroy { + ngOnDestroy() { + wasOnDestroyCalled = true; + } + } + + // This test asserts that the view tree is set up correctly based on the knowledge that this + // tree is used during view destruction. If the child view is not correctly attached as a + // child of the root view, then the onDestroy hook on the child view will never be called + // when the view tree is torn down following the destruction of that root view. + @Component({ + selector: `test-app`, + template: ``, + standalone: false, + }) + class TestApp {} + + TestBed.configureTestingModule({declarations: [ComponentWithOnDestroy, TestApp]}); + const fixture = TestBed.createComponent(TestApp); + fixture.detectChanges(); + fixture.destroy(); + expect(wasOnDestroyCalled).toBe( + true, + 'Expected component onDestroy method to be called when its parent view is destroyed', + ); + }); }); it('should be able to dynamically insert a component into a view container at the root of a component', () => { @@ -246,43 +281,6 @@ describe('component', () => { }); }); - describe('view destruction', () => { - it('should invoke onDestroy when directly destroying a root view', () => { - let wasOnDestroyCalled = false; - - @Component({ - selector: 'comp-with-destroy', - template: ``, - standalone: false, - }) - class ComponentWithOnDestroy implements OnDestroy { - ngOnDestroy() { - wasOnDestroyCalled = true; - } - } - - // This test asserts that the view tree is set up correctly based on the knowledge that this - // tree is used during view destruction. If the child view is not correctly attached as a - // child of the root view, then the onDestroy hook on the child view will never be called - // when the view tree is torn down following the destruction of that root view. - @Component({ - selector: `test-app`, - template: ``, - standalone: false, - }) - class TestApp {} - - TestBed.configureTestingModule({declarations: [ComponentWithOnDestroy, TestApp]}); - const fixture = TestBed.createComponent(TestApp); - fixture.detectChanges(); - fixture.destroy(); - expect(wasOnDestroyCalled).toBe( - true, - 'Expected component onDestroy method to be called when its parent view is destroyed', - ); - }); - }); - it("should clear the contents of dynamically created component when it's attached to ApplicationRef", () => { let wasOnDestroyCalled = false; @Component({ diff --git a/packages/core/test/acceptance/content_spec.ts b/packages/core/test/acceptance/content_spec.ts index 208e71447c0..596827ae5b4 100644 --- a/packages/core/test/acceptance/content_spec.ts +++ b/packages/core/test/acceptance/content_spec.ts @@ -8,6 +8,8 @@ import {CommonModule} from '@angular/common'; import {loadTranslations} from '@angular/localize'; +import {By} from '@angular/platform-browser'; +import {expect} from '@angular/private/testing/matchers'; import { ChangeDetectorRef, Component, @@ -23,8 +25,6 @@ import { ViewContainerRef, } from '../../src/core'; import {TestBed} from '../../testing'; -import {By} from '@angular/platform-browser'; -import {expect} from '@angular/private/testing/matchers'; describe('projection', () => { beforeEach(() => { @@ -874,7 +874,7 @@ describe('projection', () => { * Descending into projected content for selector-matching purposes is not supported * today: https://plnkr.co/edit/MYQcNfHSTKp9KvbzJWVQ?p=preview */ - it('should not descend into re-projected content', () => { + it('should not descend into re-projected content for selector matching', () => { @Component({ selector: 'grand-child', template: ` @@ -910,7 +910,7 @@ describe('projection', () => { ); }); - it('should not descend into re-projected content', () => { + it('should match selectors against the ng-content element when re-projecting', () => { @Component({ selector: 'card', template: ` @@ -1025,7 +1025,7 @@ describe('projection', () => { }); }); - it('should handle projected containers inside other containers', () => { + it('should handle projected containers inside other containers 2', () => { @Component({ selector: 'child-comp', // template: '', diff --git a/packages/core/test/acceptance/defer_spec.ts b/packages/core/test/acceptance/defer_spec.ts index 7f2c8ac5eea..59dfb90848b 100644 --- a/packages/core/test/acceptance/defer_spec.ts +++ b/packages/core/test/acceptance/defer_spec.ts @@ -7,6 +7,9 @@ */ import {CommonModule, ɵPLATFORM_BROWSER_ID as PLATFORM_BROWSER_ID} from '@angular/common'; +import {isBrowser} from '@angular/private/testing'; +import {ActivatedRoute, provideRouter, Router, RouterOutlet} from '@angular/router'; +import {Console} from '../../src/console'; import { ApplicationRef, Attribute, @@ -15,38 +18,35 @@ import { Component, createComponent, Directive, + ElementRef, EnvironmentInjector, ErrorHandler, inject, Injectable, InjectionToken, + Injector, Input, NgModule, NgZone, Pipe, PipeTransform, PLATFORM_ID, + provideZoneChangeDetection, QueryList, + ɵRuntimeError as RuntimeError, Type, + ViewChild, ViewChildren, ɵDEFER_BLOCK_DEPENDENCY_INTERCEPTOR, - ɵRuntimeError as RuntimeError, - Injector, - ElementRef, - ViewChild, - provideZoneChangeDetection, } from '../../src/core'; -import {getComponentDef} from '../../src/render3/def_getters'; -import {ComponentFixture, DeferBlockBehavior, fakeAsync, flush, TestBed, tick} from '../../testing'; -import {getInjectorResolutionPath} from '../../src/render3/util/injector_discovery_utils'; -import {ActivatedRoute, provideRouter, Router, RouterOutlet} from '@angular/router'; -import {ChainedInjector} from '../../src/render3/chained_injector'; -import {global} from '../../src/util/global'; import {TimerScheduler} from '../../src/defer/timer_scheduler'; -import {Console} from '../../src/console'; import {formatRuntimeErrorCode, RuntimeErrorCode} from '../../src/errors'; import {provideNgReflectAttributes} from '../../src/ng_reflect'; -import {isBrowser} from '@angular/private/testing'; +import {ChainedInjector} from '../../src/render3/chained_injector'; +import {getComponentDef} from '../../src/render3/def_getters'; +import {getInjectorResolutionPath} from '../../src/render3/util/injector_discovery_utils'; +import {global} from '../../src/util/global'; +import {ComponentFixture, DeferBlockBehavior, fakeAsync, flush, TestBed, tick} from '../../testing'; /** * Clears all associated directive defs from a given component class. @@ -2241,99 +2241,6 @@ describe('@defer', () => { expect(loadingFnInvokedTimes).toBe(1); }); - it('should delay nested defer blocks with `on idle` triggers', async () => { - @Component({ - selector: 'nested-cmp', - template: 'Primary block content.', - }) - class NestedCmp { - @Input() block!: string; - } - - @Component({ - selector: 'another-nested-cmp', - template: 'Nested block component.', - }) - class AnotherNestedCmp {} - - @Component({ - selector: 'root-app', - imports: [NestedCmp, AnotherNestedCmp], - template: ` - @defer (on idle; prefetch on idle) { - - - @defer (on idle) { - - } @placeholder { - Nested block placeholder - } @loading { - Nested block loading - } - } @placeholder { - Root block placeholder - } - `, - }) - class RootCmp {} - - let loadingFnInvokedTimes = 0; - const deferDepsInterceptor = { - intercept() { - return () => { - loadingFnInvokedTimes++; - const nextDeferredComponent = - loadingFnInvokedTimes === 1 ? NestedCmp : AnotherNestedCmp; - return [dynamicImportOf(nextDeferredComponent)]; - }; - }, - }; - - TestBed.configureTestingModule({ - providers: [{provide: ɵDEFER_BLOCK_DEPENDENCY_INTERCEPTOR, useValue: deferDepsInterceptor}], - }); - - clearDirectiveDefs(RootCmp); - - const fixture = TestBed.createComponent(RootCmp); - fixture.detectChanges(); - - expect(fixture.nativeElement.outerHTML).toContain('Root block placeholder'); - - // Make sure loading function is not yet invoked. - expect(loadingFnInvokedTimes).toBe(0); - - // Trigger all scheduled callbacks and await all mocked dynamic imports. - triggerIdleCallbacks(); - await allPendingDynamicImports(); - fixture.detectChanges(); - - // Expect that the loading resources function was invoked once. - expect(loadingFnInvokedTimes).toBe(1); - - // Verify primary blocks content. - expect(fixture.nativeElement.outerHTML).toContain('Primary block content'); - - // Verify that nested defer block is in a placeholder mode. - expect(fixture.nativeElement.outerHTML).toContain('Nested block placeholder'); - - // Expect that the loading resources function was not invoked again (counter remains 1). - expect(loadingFnInvokedTimes).toBe(1); - - triggerIdleCallbacks(); - await allPendingDynamicImports(); - fixture.detectChanges(); - - // Verify that nested defer block now renders the main content. - expect(fixture.nativeElement.outerHTML).toContain('Nested block component'); - - // We loaded a nested block dependency, expect counter to be 2. - expect(loadingFnInvokedTimes).toBe(2); - }); - it('should clear idle handlers when defer block is triggered', async () => { @Component({ selector: 'root-app', diff --git a/packages/core/test/acceptance/di_spec.ts b/packages/core/test/acceptance/di_spec.ts index fa19c69b477..95976490f6e 100644 --- a/packages/core/test/acceptance/di_spec.ts +++ b/packages/core/test/acceptance/di_spec.ts @@ -7,6 +7,8 @@ */ import {CommonModule} from '@angular/common'; +import {By} from '@angular/platform-browser'; +import {BehaviorSubject} from 'rxjs'; import { assertInInjectionContext, Attribute, @@ -14,7 +16,10 @@ import { Component, ComponentRef, createEnvironmentInjector, + ɵcreateInjector as createInjector, createNgModule, + ɵDEFAULT_LOCALE_ID as DEFAULT_LOCALE_ID, + DestroyRef, Directive, ElementRef, ENVIRONMENT_INITIALIZER, @@ -35,6 +40,7 @@ import { INJECTOR, Injector, Input, + ɵInternalEnvironmentProviders as InternalEnvironmentProviders, LOCALE_ID, makeEnvironmentProviders, ModuleWithProviders, @@ -46,6 +52,7 @@ import { Pipe, PipeTransform, Provider, + provideZoneChangeDetection, runInInjectionContext, Self, SkipSelf, @@ -55,19 +62,12 @@ import { ViewContainerRef, ViewEncapsulation, ViewRef, - ɵcreateInjector as createInjector, - ɵDEFAULT_LOCALE_ID as DEFAULT_LOCALE_ID, ɵINJECTOR_SCOPE, - ɵInternalEnvironmentProviders as InternalEnvironmentProviders, - DestroyRef, - provideZoneChangeDetection, } from '../../src/core'; import {ERROR_DETAILS_PAGE_BASE_URL} from '../../src/error_details_base_url'; import {RuntimeError, RuntimeErrorCode} from '../../src/errors'; import {ViewRef as ViewRefInternal} from '../../src/render3/view_ref'; import {TestBed} from '../../testing'; -import {By} from '@angular/platform-browser'; -import {BehaviorSubject} from 'rxjs'; const getProvidersByToken = ( providers: Provider[], @@ -1203,7 +1203,7 @@ describe('di', () => { expect(cmp.componentInstance.testB.a.injector).toBe('standalone'); }); - it('should not have access to the directive injector in a standalone injector from within a directive-level provider factory', () => { + it('should not have access to the directive injector in a standalone injector from within a directive-level provider factory when using Optional', () => { class TestA { constructor(public injector: string) {} } @@ -6742,7 +6742,7 @@ describe('di', () => { ); }); - it('should detect cyclic dependency in Module/Environment injector when `Injector.get` is used', () => { + it('should detect cyclic dependency in Module/Environment injector when `Injector.get` is used (multi=true)', () => { const A = new InjectionToken('A'); const B = new InjectionToken('B'); @Injectable() diff --git a/packages/core/test/acceptance/host_binding_spec.ts b/packages/core/test/acceptance/host_binding_spec.ts index d01928f0681..cb9b75859d9 100644 --- a/packages/core/test/acceptance/host_binding_spec.ts +++ b/packages/core/test/acceptance/host_binding_spec.ts @@ -8,6 +8,8 @@ import {state, style, transition, trigger} from '@angular/animations'; import {CommonModule} from '@angular/common'; +import {By} from '@angular/platform-browser'; +import {NoopAnimationsModule} from '@angular/platform-browser/animations'; import { AfterContentInit, Component, @@ -19,7 +21,6 @@ import { HostListener, Injectable, Input, - NgModule, OnChanges, OnInit, provideZoneChangeDetection, @@ -34,8 +35,6 @@ import { bypassSanitizationTrustUrl, } from '../../src/sanitization/bypass'; import {TestBed} from '../../testing'; -import {By} from '@angular/platform-browser'; -import {NoopAnimationsModule} from '@angular/platform-browser/animations'; describe('host bindings', () => { beforeEach(() => { @@ -1548,7 +1547,7 @@ describe('host bindings', () => { isAttribute: boolean = true, throws: boolean = false, ) { - it(`should sanitize <${tag} ${prop}> ${isAttribute ? 'properties' : 'attributes'}`, () => { + it(`should sanitize <${tag} ${prop}> ${isAttribute ? 'properties' : 'attributes'} (value=${value})`, () => { @Directive({ selector: '[unsafeUrlHostBindingDir]', host: { diff --git a/packages/core/test/acceptance/injector_profiler_spec.ts b/packages/core/test/acceptance/injector_profiler_spec.ts index 8dcc0ed429a..1b98dd33630 100644 --- a/packages/core/test/acceptance/injector_profiler_spec.ts +++ b/packages/core/test/acceptance/injector_profiler_spec.ts @@ -7,6 +7,8 @@ */ import {NgForOf, PercentPipe} from '@angular/common'; +import {BrowserModule} from '@angular/platform-browser'; +import {Router, RouterModule, RouterOutlet} from '@angular/router'; import { afterEveryRender, ClassProvider, @@ -37,14 +39,14 @@ import {setupFrameworkInjectorProfiler} from '../../src/render3/debug/framework_ import { getInjectorProfilerContext, InjectedServiceEvent, - InjectorToCreateInstanceEvent, InjectorCreatedInstanceEvent, - InjectorProfilerEvent, - InjectorProfilerEventType, - ProviderConfiguredEvent, - setInjectorProfiler, injectorProfiler, InjectorProfilerContext, + InjectorProfilerEvent, + InjectorProfilerEventType, + InjectorToCreateInstanceEvent, + ProviderConfiguredEvent, + setInjectorProfiler, } from '../../src/render3/debug/injector_profiler'; import {getNodeInjectorLView, NodeInjector} from '../../src/render3/di'; import { @@ -53,10 +55,8 @@ import { getInjectorProviders, getInjectorResolutionPath, } from '../../src/render3/util/injector_discovery_utils'; -import {fakeAsync, tick} from '../../testing'; +import {fakeAsync} from '../../testing'; import {TestBed} from '../../testing/src/test_bed'; -import {BrowserModule} from '@angular/platform-browser'; -import {Router, RouterModule, RouterOutlet} from '@angular/router'; describe('setProfiler', () => { let injectEvents: InjectedServiceEvent[] = []; @@ -385,7 +385,7 @@ describe('setProfiler', () => { }); }); -describe('profiler activation and removal', () => { +describe('Injector profiler activation and removal', () => { class SomeClass {} const fakeContext: InjectorProfilerContext = { diff --git a/packages/core/test/acceptance/integration_spec.ts b/packages/core/test/acceptance/integration_spec.ts index 80c34326f49..c364eaf74ed 100644 --- a/packages/core/test/acceptance/integration_spec.ts +++ b/packages/core/test/acceptance/integration_spec.ts @@ -2262,7 +2262,7 @@ describe('acceptance integration tests', () => { expect(content).toContain(``); }); - it('should handle safe keyed reads inside templates', () => { + it('should handle safe keyed reads inside templates (indexed access)', () => { @Component({ template: ` diff --git a/packages/core/test/acceptance/local_compilation_spec.ts b/packages/core/test/acceptance/local_compilation_spec.ts index a290cb1beda..ade16518d98 100644 --- a/packages/core/test/acceptance/local_compilation_spec.ts +++ b/packages/core/test/acceptance/local_compilation_spec.ts @@ -221,7 +221,7 @@ describe('component dependencies in local compilation', () => { expect(deps).toEqual(jasmine.arrayWithExactContents([SubComponent, MainComponent])); }); - it('should compute correct set of dependencies when importing ng-modules with providers using forward ref', () => { + it('should compute correct set of dependencies when importing ng-modules with providers using forward ref (nested in arrays)', () => { @Component({ selector: 'sub', standalone: false, diff --git a/packages/core/test/acceptance/profiler_spec.ts b/packages/core/test/acceptance/profiler_spec.ts index 7b8fd67f185..78a31476ef8 100644 --- a/packages/core/test/acceptance/profiler_spec.ts +++ b/packages/core/test/acceptance/profiler_spec.ts @@ -6,8 +6,8 @@ * found in the LICENSE file at https://angular.dev/license */ -import {setProfiler, profiler} from '../../src/render3/profiler'; import {ProfilerEvent} from '../../primitives/devtools'; +import {profiler, setProfiler} from '../../src/render3/profiler'; import {TestBed} from '../../testing'; import { @@ -507,7 +507,7 @@ describe('profiler', () => { expect(p.hasEvents(ProfilerEvent.ComponentStart, ProfilerEvent.ComponentEnd)).toBeTrue(); }); - it('should capture child component change detection events when a template error occurs', () => { + it('should capture child component change detection events when a template error occurs (has start & end)', () => { @Component({selector: 'my-child', template: '{{ error() }}'}) class ChildComponent { error() { @@ -526,7 +526,7 @@ describe('profiler', () => { expect(p.hasEvents(ProfilerEvent.ComponentStart, ProfilerEvent.ComponentEnd)).toBeTrue(); }); - it('should capture child component change detection events when a template error occurs', () => { + it('should capture child component change detection events when a template error occurs (extensive check)', () => { @Component({selector: 'my-child', template: '{{ error() }}'}) class ChildComponent { error() { diff --git a/packages/core/test/acceptance/security_spec.ts b/packages/core/test/acceptance/security_spec.ts index 79f61394e8e..e0da38ba043 100644 --- a/packages/core/test/acceptance/security_spec.ts +++ b/packages/core/test/acceptance/security_spec.ts @@ -7,6 +7,7 @@ */ import {NgIf} from '@angular/common'; +import {DomSanitizer} from '@angular/platform-browser'; import { Component, Directive, @@ -20,7 +21,6 @@ import { import {RuntimeErrorCode} from '../../src/errors'; import {global} from '../../src/util/global'; import {ComponentFixture, TestBed} from '../../testing'; -import {DomSanitizer} from '@angular/platform-browser'; describe('comment node text escaping', () => { // see: https://html.spec.whatwg.org/multipage/syntax.html#comments @@ -146,7 +146,7 @@ describe('iframe processing', () => { ['src', 'srcdoc'].forEach((srcAttr: string) => { it( `should work when a security-sensitive attribute is set ` + - `as a static attribute (checking \`${securityAttr}\`)`, + `as a static attribute (checking \`${securityAttr}\` with \`${srcAttr}\`)`, () => { @Component({ selector: 'my-comp', @@ -161,7 +161,7 @@ describe('iframe processing', () => { it( `should work when a security-sensitive attribute is set ` + `as a static attribute (checking \`${securityAttr}\` and ` + - `making sure it's case-insensitive)`, + `making sure it's case-insensitive, with \`${srcAttr}\`)`, () => { @Component({ selector: 'my-comp', @@ -179,7 +179,7 @@ describe('iframe processing', () => { it( `should error when a security-sensitive attribute is applied ` + - `using a property binding (checking \`${securityAttr}\`)`, + `using a property binding (checking \`${securityAttr}\`, with \`${srcAttr}\`)`, () => { @Component({ selector: 'my-comp', @@ -196,7 +196,7 @@ describe('iframe processing', () => { it( `should error when a security-sensitive attribute is applied ` + - `using a property interpolation (checking \`${securityAttr}\`)`, + `using a property interpolation (checking \`${securityAttr}\`, with \`${srcAttr}\`)`, () => { @Component({ selector: 'my-comp', @@ -214,7 +214,7 @@ describe('iframe processing', () => { it( `should error when a security-sensitive attribute is applied ` + `using a property binding (checking \`${securityAttr}\`, making ` + - `sure it's case-insensitive)`, + `sure it's case-insensitive, with \`${srcAttr}\`)`, () => { @Component({ selector: 'my-comp', @@ -233,7 +233,7 @@ describe('iframe processing', () => { it( `should error when a security-sensitive attribute is applied ` + - `using a property binding (checking \`${securityAttr}\`)`, + `using a property binding (checking \`${securityAttr}\` (attr.), with \`${srcAttr}\`)`, () => { @Component({ selector: 'my-comp', @@ -249,8 +249,8 @@ describe('iframe processing', () => { it( `should error when a security-sensitive attribute is applied ` + - `using a property binding (checking \`${securityAttr}\`, making ` + - `sure it's case-insensitive)`, + `using a property binding (checking \`${securityAttr}\` with [attr.], making ` + + `sure it's case-insensitive, with \`${srcAttr}\`)`, () => { @Component({ selector: 'my-comp', @@ -267,7 +267,7 @@ describe('iframe processing', () => { }, ); - it(`should allow changing \`${srcAttr}\` after initial render`, () => { + it(`should allow changing \`${srcAttr}\` after initial render with \`${securityAttr}\``, () => { @Component({ selector: 'my-comp', template: ` `, diff --git a/packages/core/test/acceptance/standalone_spec.ts b/packages/core/test/acceptance/standalone_spec.ts index 82e7bb1538f..affac307670 100644 --- a/packages/core/test/acceptance/standalone_spec.ts +++ b/packages/core/test/acceptance/standalone_spec.ts @@ -833,7 +833,7 @@ describe('standalone components, directives, and pipes', () => { expect(fixture.nativeElement.textContent).toBe('standalone: input value'); }); - it('should allow extending a regular component and turn it into a standalone one', () => { + it('should allow extending a standalone component and turn it into a regular one', () => { @Component({selector: 'standalone', template: 'standalone: {{in}}'}) class StandaloneCmp { @Input() input: string | undefined; diff --git a/packages/core/test/acceptance/styling_spec.ts b/packages/core/test/acceptance/styling_spec.ts index f3a31b2313c..85c268fed0c 100644 --- a/packages/core/test/acceptance/styling_spec.ts +++ b/packages/core/test/acceptance/styling_spec.ts @@ -6,6 +6,8 @@ * found in the LICENSE file at https://angular.dev/license */ import {CommonModule} from '@angular/common'; +import {By, DomSanitizer, SafeStyle} from '@angular/platform-browser'; +import {isBrowser} from '@angular/private/testing'; import { Component, ComponentRef, @@ -26,8 +28,6 @@ import { getSortedClassName, getSortedStyle, } from '../../testing/src/styling'; -import {By, DomSanitizer, SafeStyle} from '@angular/platform-browser'; -import {isBrowser} from '@angular/private/testing'; describe('styling', () => { beforeEach(() => { @@ -2356,7 +2356,6 @@ describe('styling', () => { class Cmp { widthExp = ''; bgImageExp = ''; - styleMapExp: any = {}; } TestBed.configureTestingModule({declarations: [Cmp]}); @@ -2379,7 +2378,7 @@ describe('styling', () => { expect(div.style.getPropertyValue('width')).toEqual('789px'); }); - it('should not sanitize style values before writing them', () => { + it('should not sanitize style values before writing them with styleMap', () => { @Component({ template: `
`, standalone: false, @@ -2441,29 +2440,6 @@ describe('styling', () => { expect(getSortedStyle(div)).toEqual('width: 0px;'); }); - it('should be able to bind a SafeValue to clip-path', () => { - @Component({ - template: '
', - standalone: false, - }) - class Cmp { - path!: SafeStyle; - } - - TestBed.configureTestingModule({declarations: [Cmp]}); - const fixture = TestBed.createComponent(Cmp); - const sanitizer: DomSanitizer = TestBed.inject(DomSanitizer); - - fixture.componentInstance.path = sanitizer.bypassSecurityTrustStyle('url("#test")'); - fixture.detectChanges(); - - const html = fixture.nativeElement.innerHTML; - - // Note that check the raw HTML, because (at the time of writing) the Node-based renderer - // that we use to run tests doesn't support `clip-path` in `CSSStyleDeclaration`. - expect(html).toMatch(/style=["|']clip-path:\s*url\(.*#test.*\)/); - }); - it('should handle values wrapped into SafeValue', () => { @Component({ template: ` diff --git a/packages/core/test/acceptance/view_container_ref_spec.ts b/packages/core/test/acceptance/view_container_ref_spec.ts index ce27b86aa84..58d99f924af 100644 --- a/packages/core/test/acceptance/view_container_ref_spec.ts +++ b/packages/core/test/acceptance/view_container_ref_spec.ts @@ -8,6 +8,10 @@ import {CommonModule, DOCUMENT} from '@angular/common'; import {computeMsgId} from '@angular/compiler'; +import {clearTranslations, loadTranslations} from '@angular/localize'; +import {By, DomSanitizer} from '@angular/platform-browser'; +import {expect} from '@angular/private/testing/matchers'; +import {ANIMATION_QUEUE} from '../../src/animation/queue'; import { ChangeDetectorRef, Compiler, @@ -45,10 +49,6 @@ import { ɵsetDocument, } from '../../src/core'; import {ComponentFixture, TestBed, TestComponentRenderer} from '../../testing'; -import {clearTranslations, loadTranslations} from '@angular/localize'; -import {By, DomSanitizer} from '@angular/platform-browser'; -import {expect} from '@angular/private/testing/matchers'; -import {ANIMATION_QUEUE} from '../../src/animation/queue'; describe('ViewContainerRef', () => { /** @@ -224,7 +224,7 @@ describe('ViewContainerRef', () => { describe('element namespaces', () => { function runTestWithSelectors(svgSelector: string, mathMLSelector: string) { - it('should be set correctly for host elements of dynamically created components', () => { + it(`should be set correctly for host elements of dynamically created components (${svgSelector})`, () => { @Component({ selector: svgSelector, template: '', @@ -497,6 +497,42 @@ describe('ViewContainerRef', () => { expect(fixture.nativeElement.textContent).toEqual('012'); }); + + it('should move embedded views and associated DOM nodes without recreating them', () => { + TestBed.configureTestingModule({declarations: [EmbeddedViewInsertionComp, VCRefDirective]}); + const fixture = TestBed.createComponent(EmbeddedViewInsertionComp); + const vcRefDir = fixture.debugElement + .query(By.directive(VCRefDirective)) + .injector.get(VCRefDirective); + fixture.detectChanges(); + + vcRefDir.createView('A'); + vcRefDir.createView('B'); + vcRefDir.createView('C'); + + fixture.detectChanges(); + expect(getElementHtml(fixture.nativeElement)).toEqual('

ABC'); + + // The DOM is manually modified here to ensure that the text node is actually moved + fixture.nativeElement.childNodes[2].nodeValue = '**A**'; + expect(getElementHtml(fixture.nativeElement)).toEqual('

**A**BC'); + + let viewRef = vcRefDir.vcref.get(0); + vcRefDir.vcref.move(viewRef!, 2); + fixture.detectChanges(); + expect(getElementHtml(fixture.nativeElement)).toEqual('

BC**A**'); + + vcRefDir.vcref.move(viewRef!, 0); + fixture.detectChanges(); + expect(getElementHtml(fixture.nativeElement)).toEqual('

**A**BC'); + + vcRefDir.vcref.move(viewRef!, 1); + fixture.detectChanges(); + expect(getElementHtml(fixture.nativeElement)).toEqual('

B**A**C'); + + expect(() => vcRefDir.vcref.move(viewRef!, -1)).toThrow(); + expect(() => vcRefDir.vcref.move(viewRef!, 42)).toThrow(); + }); }); it('should not throw when calling remove() on an empty container', () => { @@ -756,44 +792,6 @@ describe('ViewContainerRef', () => { }); }); - describe('move', () => { - it('should move embedded views and associated DOM nodes without recreating them', () => { - TestBed.configureTestingModule({declarations: [EmbeddedViewInsertionComp, VCRefDirective]}); - const fixture = TestBed.createComponent(EmbeddedViewInsertionComp); - const vcRefDir = fixture.debugElement - .query(By.directive(VCRefDirective)) - .injector.get(VCRefDirective); - fixture.detectChanges(); - - vcRefDir.createView('A'); - vcRefDir.createView('B'); - vcRefDir.createView('C'); - - fixture.detectChanges(); - expect(getElementHtml(fixture.nativeElement)).toEqual('

ABC'); - - // The DOM is manually modified here to ensure that the text node is actually moved - fixture.nativeElement.childNodes[2].nodeValue = '**A**'; - expect(getElementHtml(fixture.nativeElement)).toEqual('

**A**BC'); - - let viewRef = vcRefDir.vcref.get(0); - vcRefDir.vcref.move(viewRef!, 2); - fixture.detectChanges(); - expect(getElementHtml(fixture.nativeElement)).toEqual('

BC**A**'); - - vcRefDir.vcref.move(viewRef!, 0); - fixture.detectChanges(); - expect(getElementHtml(fixture.nativeElement)).toEqual('

**A**BC'); - - vcRefDir.vcref.move(viewRef!, 1); - fixture.detectChanges(); - expect(getElementHtml(fixture.nativeElement)).toEqual('

B**A**C'); - - expect(() => vcRefDir.vcref.move(viewRef!, -1)).toThrow(); - expect(() => vcRefDir.vcref.move(viewRef!, 42)).toThrow(); - }); - }); - describe('getters for the anchor node', () => { it('should work on templates', () => { @Component({ diff --git a/packages/core/test/change_detection/differs/default_keyvalue_differ_spec.ts b/packages/core/test/change_detection/differs/default_keyvalue_differ_spec.ts index 079508cc0a9..e5081752530 100644 --- a/packages/core/test/change_detection/differs/default_keyvalue_differ_spec.ts +++ b/packages/core/test/change_detection/differs/default_keyvalue_differ_spec.ts @@ -213,7 +213,7 @@ describe('keyvalue differ', function () { ); }); - it('should work regardless key order', () => { + it('should work regardless key order for object literals', () => { differ.check({a: 0, b: 0}); differ.check({b: 1, a: 1}); @@ -227,7 +227,7 @@ describe('keyvalue differ', function () { }); // https://github.com/angular/angular/issues/14997 - it('should work regardless key order', () => { + it('should work with re-insertion of keys in object literals', () => { differ.check({a: 1, b: 2}); differ.check({b: 3, a: 2}); differ.check({a: 1, b: 2}); diff --git a/packages/core/test/linker/integration_spec.ts b/packages/core/test/linker/integration_spec.ts index 81877fc51ee..094e04f28fa 100644 --- a/packages/core/test/linker/integration_spec.ts +++ b/packages/core/test/linker/integration_spec.ts @@ -7,6 +7,13 @@ */ import {CommonModule, DOCUMENT, ɵgetDOM as getDOM} from '@angular/common'; +import {createMouseEvent, dispatchEvent, el, isCommentNode} from '@angular/private/testing'; +import {expect} from '@angular/private/testing/matchers'; +import { + ChangeDetectionStrategy, + ChangeDetectorRef, + PipeTransform, +} from '../../src/change_detection/change_detection'; import { Attribute, Compiler, @@ -40,11 +47,6 @@ import { ViewRef, ɵsetClassDebugInfo, } from '../../src/core'; -import { - ChangeDetectionStrategy, - ChangeDetectorRef, - PipeTransform, -} from '../../src/change_detection/change_detection'; import {ComponentFactoryResolver} from '../../src/linker/component_factory_resolver'; import {ElementRef} from '../../src/linker/element_ref'; import {QueryList} from '../../src/linker/query_list'; @@ -52,8 +54,6 @@ import {TemplateRef} from '../../src/linker/template_ref'; import {ViewContainerRef} from '../../src/linker/view_container_ref'; import {EmbeddedViewRef} from '../../src/linker/view_ref'; import {fakeAsync, getTestBed, TestBed, tick, waitForAsync} from '../../testing'; -import {createMouseEvent, dispatchEvent, el, isCommentNode} from '@angular/private/testing'; -import {expect} from '@angular/private/testing/matchers'; import {stringify} from '../../src/util/stringify'; @@ -1742,7 +1742,7 @@ describe('integration tests', function () { ); }); - it('should throw on bindings to unknown properties', () => { + it('should throw on bindings to unknown properties (micro-syntax)', () => { TestBed.configureTestingModule({imports: [CommonModule], declarations: [MyComp]}); const template = '
{{item}}
'; TestBed.overrideComponent(MyComp, {set: {template}}); diff --git a/packages/core/test/linker/query_integration_spec.ts b/packages/core/test/linker/query_integration_spec.ts index eeefe7599d1..7d1712f08fa 100644 --- a/packages/core/test/linker/query_integration_spec.ts +++ b/packages/core/test/linker/query_integration_spec.ts @@ -6,6 +6,8 @@ * found in the LICENSE file at https://angular.dev/license */ +import {expect} from '@angular/private/testing/matchers'; +import {Subject} from 'rxjs'; import { AfterContentChecked, AfterContentInit, @@ -16,18 +18,16 @@ import { ContentChild, ContentChildren, Directive, + ElementRef, + provideZoneChangeDetection, QueryList, TemplateRef, Type, ViewChild, ViewChildren, ViewContainerRef, - ElementRef, - provideZoneChangeDetection, } from '../../src/core'; import {ComponentFixture, TestBed, waitForAsync} from '../../testing'; -import {expect} from '@angular/private/testing/matchers'; -import {Subject} from 'rxjs'; import {stringify} from '../../src/util/stringify'; @@ -625,7 +625,7 @@ describe('Query API', () => { expect(q.query.map((d: TextDirective) => d.text)).toEqual(['1', '-3', '2', '4']); }); - it('should maintain directives in pre-order depth-first DOM order after dynamic insertion', () => { + it('should maintain directives in pre-order depth-first DOM order after dynamic insertion inside a parent element', () => { const template = ''; const view = createTestCmpAndDetectChanges(MyComp0, template); const q: NeedsViewQueryOrderWithParent = view.debugElement.children[0].references!['q']; diff --git a/packages/core/test/linker/query_list_spec.ts b/packages/core/test/linker/query_list_spec.ts index 798b8944c99..ef046cd2ecf 100644 --- a/packages/core/test/linker/query_list_spec.ts +++ b/packages/core/test/linker/query_list_spec.ts @@ -113,10 +113,6 @@ describe('QueryList', () => { it('should support toArray', () => { queryList.reset(['one', 'two']); expect(queryList.reduce((a: string, x: string) => a + x, 'start:')).toEqual('start:onetwo'); - }); - - it('should support toArray', () => { - queryList.reset(['one', 'two']); expect(queryList.toArray()).toEqual(['one', 'two']); }); diff --git a/packages/core/test/linker/view_injector_integration_spec.ts b/packages/core/test/linker/view_injector_integration_spec.ts index 849244dc1ee..28f72524193 100644 --- a/packages/core/test/linker/view_injector_integration_spec.ts +++ b/packages/core/test/linker/view_injector_integration_spec.ts @@ -6,6 +6,7 @@ * found in the LICENSE file at https://angular.dev/license */ +import {expect} from '@angular/private/testing/matchers'; import { Attribute, ChangeDetectionStrategy, @@ -23,7 +24,6 @@ import { InjectionToken, Injector, Input, - NgModule, Optional, Pipe, PipeTransform, @@ -34,9 +34,8 @@ import { Type, ViewContainerRef, } from '../../src/core'; -import {ComponentFixture, fakeAsync, TestBed} from '../../testing'; -import {expect} from '@angular/private/testing/matchers'; import {ERROR_DETAILS_PAGE_BASE_URL} from '../../src/error_details_base_url'; +import {ComponentFixture, fakeAsync, TestBed} from '../../testing'; @Directive({ selector: '[simpleDirective]', @@ -1014,7 +1013,7 @@ describe('View injector', () => { expect(compEl.nativeElement).toHaveText('0'); }); - it('should inject ViewContainerRef', () => { + it('should inject ViewContainerRef (injector)', () => { TestBed.configureTestingModule({declarations: [NeedsViewContainerRef]}); const el = createComponent('
'); expect( @@ -1022,7 +1021,7 @@ describe('View injector', () => { ).toBe(el.children[0].nativeElement); }); - it('should inject ViewContainerRef', () => { + it('should inject ViewContainerRef (constructor DI)', () => { @Component({ template: '', standalone: false, diff --git a/packages/core/test/render3/instructions_spec.ts b/packages/core/test/render3/instructions_spec.ts index 63dc5bd5b00..3cb2ebe1bb8 100644 --- a/packages/core/test/render3/instructions_spec.ts +++ b/packages/core/test/render3/instructions_spec.ts @@ -410,7 +410,7 @@ describe('instructions', () => { expect(s.lastSanitizedValue).toBeFalsy(); }); - it('should bypass ivy-level script sanitization if a custom sanitizer is used', () => { + it('should bypass ivy-level script sanitization if a custom sanitizer is used (trurst script)', () => { const s = new LocalMockSanitizer((value) => ''); const t = new ViewFixture({create: createScript, decls: 1, vars: 1, sanitizer: s}); const inputValue = bypassSanitizationTrustScript('alert("bar")'); @@ -449,7 +449,7 @@ describe('instructions', () => { expect(s.lastSanitizedValue).toBeFalsy(); }); - it('should bypass ivy-level script sanitization if a custom sanitizer is used', () => { + it('should bypass ivy-level script sanitization if a custom sanitizer is used (trust html)', () => { const s = new LocalMockSanitizer((value) => ''); const t = new ViewFixture({create: createDiv, decls: 1, vars: 1, sanitizer: s}); const inputValue = bypassSanitizationTrustHtml('
'); diff --git a/packages/core/test/test_bed_spec.ts b/packages/core/test/test_bed_spec.ts index 1aba5b49800..4716ecbaa7a 100644 --- a/packages/core/test/test_bed_spec.ts +++ b/packages/core/test/test_bed_spec.ts @@ -7,15 +7,23 @@ */ import {ɵPLATFORM_BROWSER_ID} from '@angular/common'; +import {By} from '@angular/platform-browser'; +import {expect} from '@angular/private/testing/matchers'; import { APP_INITIALIZER, ChangeDetectorRef, Compiler, - provideZoneChangeDetection, Component, + ɵɵdefineComponent as defineComponent, + ɵɵdefineInjector as defineInjector, + ɵɵdefineNgModule as defineNgModule, Directive, + DOCUMENT, + ɵɵelementEnd as elementEnd, ElementRef, + ɵɵelementStart as elementStart, ErrorHandler, + EventEmitter, getNgModuleById, inject, Inject, @@ -24,35 +32,27 @@ import { InjectOptions, Injector, Input, + inputBinding, LOCALE_ID, ModuleWithProviders, NgModule, Optional, + Output, + outputBinding, Pipe, PLATFORM_ID, + provideZoneChangeDetection, + provideZonelessChangeDetection, + ɵsetClassMetadata as setClassMetadata, + ɵɵsetNgModuleScope as setNgModuleScope, + signal, + ɵɵtext as text, + twoWayBinding, Type, ViewChild, - ɵsetClassMetadata as setClassMetadata, - ɵɵdefineComponent as defineComponent, - ɵɵdefineInjector as defineInjector, - ɵɵdefineNgModule as defineNgModule, - ɵɵelementEnd as elementEnd, - ɵɵelementStart as elementStart, - ɵɵsetNgModuleScope as setNgModuleScope, - ɵɵtext as text, - DOCUMENT, - signal, - provideZonelessChangeDetection, - inputBinding, - Output, - EventEmitter, - outputBinding, - twoWayBinding, } from '../src/core'; import {DeferBlockBehavior} from '../testing'; import {TestBed, TestBedImpl} from '../testing/src/test_bed'; -import {By} from '@angular/platform-browser'; -import {expect} from '@angular/private/testing/matchers'; import {NgModuleType} from '../src/render3'; import {depsTracker} from '../src/render3/deps_tracker/deps_tracker'; @@ -194,7 +194,7 @@ export class ComponentWithInlineTemplate {} }) export class HelloWorldModule {} -describe('TestBed', () => { +describe('TestBed (isolated)', () => { // This test is extracted to an individual `describe` block to avoid any extra TestBed // initialization logic that happens in the `beforeEach` functions in other `describe` sections. it('should apply scopes correctly for components in the lazy-loaded module', () => { @@ -2715,19 +2715,6 @@ describe('TestBed module teardown', () => { expect(fixtureDocument.querySelectorAll('style').length).toBeLessThan(styleCountBefore); }); - it('should remove the fixture root element from the DOM when module teardown is enabled', () => { - TestBed.configureTestingModule({ - declarations: [SimpleCmp], - teardown: {destroyAfterEach: true}, - }); - const fixture = TestBed.createComponent(SimpleCmp); - const fixtureDocument = fixture.nativeElement.ownerDocument; - - expect(fixtureDocument.body.contains(fixture.nativeElement)).toBe(true); - TestBed.resetTestingModule(); - expect(fixtureDocument.body.contains(fixture.nativeElement)).toBe(false); - }); - it('should rethrow errors based on the default teardown behavior', () => { expect(TestBedImpl.INSTANCE.shouldRethrowTeardownErrors()).toBe( TEARDOWN_TESTING_MODULE_ON_DESTROY_DEFAULT, diff --git a/packages/core/test/util/array_utils_spec.ts b/packages/core/test/util/array_utils_spec.ts index 81b28f7a16b..234ce31424b 100644 --- a/packages/core/test/util/array_utils_spec.ts +++ b/packages/core/test/util/array_utils_spec.ts @@ -73,7 +73,7 @@ describe('array_utils', () => { expectArrayInsert([0, 1, 2], 3, 'A').toEqual([0, 1, 2, 'A']); }); - it('should insert items', () => { + it('should insert two items at once', () => { expectArrayInsert2([], 0, 'A', 'B').toEqual(['A', 'B']); expectArrayInsert2([0], 0, 'A', 'B').toEqual(['A', 'B', 0]); expectArrayInsert2([0], 1, 'A', 'B').toEqual([0, 'A', 'B']); diff --git a/packages/core/test/util/stringify_spec.ts b/packages/core/test/util/stringify_spec.ts index 3d19fc58052..b463af7f9d5 100644 --- a/packages/core/test/util/stringify_spec.ts +++ b/packages/core/test/util/stringify_spec.ts @@ -5,9 +5,15 @@ * Use of this source code is governed by an MIT-style license that can be * found in the LICENSE file at https://angular.dev/license */ -import {concatStringsWithSpace} from '../../src/util/stringify'; +import {concatStringsWithSpace, stringify} from '../../src/util/stringify'; describe('stringify', () => { + it('should return string undefined when toString returns undefined', () => + expect(stringify({toString: (): any => undefined})).toBe('undefined')); + + it('should return string null when toString returns null', () => + expect(stringify({toString: (): any => null})).toBe('null')); + describe('concatStringsWithSpace', () => { it('should concat with null', () => { expect(concatStringsWithSpace(null, null)).toEqual(''); diff --git a/packages/core/test/util_spec.ts b/packages/core/test/util_spec.ts deleted file mode 100644 index 1e6f7519d96..00000000000 --- a/packages/core/test/util_spec.ts +++ /dev/null @@ -1,17 +0,0 @@ -/** - * @license - * Copyright Google LLC All Rights Reserved. - * - * Use of this source code is governed by an MIT-style license that can be - * found in the LICENSE file at https://angular.dev/license - */ - -import {stringify} from '../src/util/stringify'; - -describe('stringify', () => { - it('should return string undefined when toString returns undefined', () => - expect(stringify({toString: (): any => undefined})).toBe('undefined')); - - it('should return string null when toString returns null', () => - expect(stringify({toString: (): any => null})).toBe('null')); -}); diff --git a/packages/examples/core/testing/ts/fake_async.ts b/packages/examples/core/testing/ts/fake_async.ts index 7c853bab709..882c7e6ad1f 100644 --- a/packages/examples/core/testing/ts/fake_async.ts +++ b/packages/examples/core/testing/ts/fake_async.ts @@ -6,7 +6,7 @@ * found in the LICENSE file at https://angular.dev/license */ -import {discardPeriodicTasks, fakeAsync, tick} from '@angular/core/testing'; +import {fakeAsync, tick} from '@angular/core/testing'; // #docregion basic describe('this test', () => { @@ -26,18 +26,3 @@ describe('this test', () => { ); }); // #enddocregion - -describe('this test', () => { - it( - 'aborts a periodic timer', - fakeAsync((): void => { - // This timer is scheduled but doesn't need to complete for the - // test to pass (maybe it's a timeout for some operation). - // Leaving it will cause the test to fail... - setInterval(() => {}, 100); - - // Unless we clean it up first. - discardPeriodicTasks(); - }), - ); -}); diff --git a/packages/forms/signals/test/node/field_node.spec.ts b/packages/forms/signals/test/node/field_node.spec.ts index c820fdd86e1..cb770d41fb7 100644 --- a/packages/forms/signals/test/node/field_node.spec.ts +++ b/packages/forms/signals/test/node/field_node.spec.ts @@ -56,7 +56,7 @@ describe('FieldNode', () => { expect(f.a).toBe(child); }); - it('should get the same instance when asking for a child multiple times', () => { + it('should get the same instance when asking for a child multiple times (after update)', () => { const value = signal<{a: number; b?: number}>({a: 1, b: 2}); const f = form(value, {injector: TestBed.inject(Injector)}); const child = f.a; @@ -90,18 +90,6 @@ describe('FieldNode', () => { expect(childA()).toBeDefined(); }); - it('can get a child inside of a computed', () => { - const f = form( - signal({ - a: 1, - b: 2, - }), - {injector: TestBed.inject(Injector)}, - ); - const childA = computed(() => f.a); - expect(childA()).toBeDefined(); - }); - describe('resetting', () => { it('can be reset with a value', () => { const model = signal({a: 1, b: 2}); diff --git a/packages/forms/signals/test/node/path.spec.ts b/packages/forms/signals/test/node/path.spec.ts index de6fffa7c94..cc066e9cf0b 100644 --- a/packages/forms/signals/test/node/path.spec.ts +++ b/packages/forms/signals/test/node/path.spec.ts @@ -70,7 +70,7 @@ describe('path', () => { ); }); - it('Disallows using parent paths for apply', () => { + it('Disallows using parent paths for apply with array', () => { const data = signal({ needLastName: false, items: [{first: '', last: ''}], diff --git a/packages/forms/signals/test/node/resource.spec.ts b/packages/forms/signals/test/node/resource.spec.ts index bfea848fa62..fa50b4a9c2e 100644 --- a/packages/forms/signals/test/node/resource.spec.ts +++ b/packages/forms/signals/test/node/resource.spec.ts @@ -159,7 +159,7 @@ describe('resources', () => { ]); }); - it('should support tree validation for resources', async () => { + it('should support tree validation for resources (multiple errors)', async () => { const s: SchemaOrSchemaFn = function (p) { validateAsync(p, { params: ({value}) => value(), diff --git a/packages/forms/test/form_group_spec.ts b/packages/forms/test/form_group_spec.ts index 12a2fddc5b5..87046f7ddc6 100644 --- a/packages/forms/test/form_group_spec.ts +++ b/packages/forms/test/form_group_spec.ts @@ -6,6 +6,7 @@ * found in the LICENSE file at https://angular.dev/license */ +import {filter, map, of} from 'rxjs'; import { AbstractControl, ControlEvent, @@ -16,8 +17,8 @@ import { Validators, ValueChangeEvent, } from '../index'; -import {filter, map, of} from 'rxjs'; +import {FormControlStatus, StatusChangeEvent} from '../src/model/abstract_model'; import { asyncValidator, asyncValidatorReturningObservable, @@ -26,7 +27,6 @@ import { timeout, useAutoTick, } from './util'; -import {FormControlStatus, StatusChangeEvent} from '../src/model/abstract_model'; (function () { function simpleValidator(c: AbstractControl): ValidationErrors | null { @@ -854,7 +854,7 @@ import {FormControlStatus, StatusChangeEvent} from '../src/model/abstract_model' expect(logger).toEqual(['control1', 'control2', 'group', 'form']); }); - it('should emit one statusChange event per reset control', () => { + it('should emit one statusChange event per reset control (with value)', () => { form.statusChanges.subscribe(() => logger.push('form')); g.statusChanges.subscribe(() => logger.push('group')); c.statusChanges.subscribe(() => logger.push('control1')); diff --git a/packages/forms/test/reactive_integration_spec.ts b/packages/forms/test/reactive_integration_spec.ts index e7dd7aed4e8..dc94b3f1cde 100644 --- a/packages/forms/test/reactive_integration_spec.ts +++ b/packages/forms/test/reactive_integration_spec.ts @@ -3766,7 +3766,7 @@ describe('reactive forms integration tests', () => { } // Run tests for both `FormControlName` and `FormControl` directives ['formControl', 'formControlName'].forEach((dir: string) => { - it('should validate max', () => { + it(`should validate max for ${dir}`, () => { const fixture = initTest(getComponent(dir)); const control = new FormControl(5); fixture.componentInstance.control = control; @@ -3810,7 +3810,7 @@ describe('reactive forms integration tests', () => { expect(form.controls['pin'].errors).toBeNull(); }); - it('should validate max for float number', () => { + it(`should validate max for float number for ${dir}`, () => { const fixture = initTest(getComponent(dir)); const control = new FormControl(10.25); fixture.componentInstance.control = control; @@ -3846,7 +3846,7 @@ describe('reactive forms integration tests', () => { expect(form.controls['pin'].errors).toBeNull(); }); - it('should apply max validation when control value is defined as a string', () => { + it(`should apply max validation when control value is defined as a string for ${dir}`, () => { const fixture = initTest(getComponent(dir)); const control = new FormControl('5'); fixture.componentInstance.control = control; @@ -3873,7 +3873,7 @@ describe('reactive forms integration tests', () => { expect(form.controls['pin'].errors).toEqual({max: {max: 1, actual: 2}}); }); - it('should validate min', () => { + it(`should validate min for ${dir}`, () => { const fixture = initTest(getComponent(dir)); const control = new FormControl(5); fixture.componentInstance.control = control; @@ -3914,7 +3914,7 @@ describe('reactive forms integration tests', () => { expect(form.controls['pin'].errors).toBeNull(); }); - it('should validate min for float number', () => { + it(`should validate min for float number for ${dir}`, () => { const fixture = initTest(getComponent(dir)); const control = new FormControl(10.25); fixture.componentInstance.control = control; @@ -3951,7 +3951,7 @@ describe('reactive forms integration tests', () => { expect(form.controls['pin'].errors).toBeNull(); }); - it('should apply min validation when control value is defined as a string', () => { + it(`should apply min validation when control value is defined as a string for ${dir}`, () => { const fixture = initTest(getComponent(dir)); const control = new FormControl('5'); fixture.componentInstance.control = control; @@ -3978,7 +3978,7 @@ describe('reactive forms integration tests', () => { expect(form.controls['pin'].errors).toEqual({min: {min: 5, actual: 2}}); }); - it('should run min/max validation for empty values', () => { + it(`should run min/max validation for empty values for ${dir}`, () => { const fixture = initTest(getComponent(dir)); const minValidateFnSpy = spyOn(MinValidator.prototype, 'validate'); const maxValidateFnSpy = spyOn(MaxValidator.prototype, 'validate'); @@ -3998,7 +3998,7 @@ describe('reactive forms integration tests', () => { expect(maxValidateFnSpy).toHaveBeenCalled(); }); - it('should run min/max validation when constraints are represented as strings', () => { + it(`should run min/max validation when constraints are represented as strings for ${dir}`, () => { const fixture = initTest(getComponent(dir)); const control = new FormControl(5); @@ -4035,7 +4035,7 @@ describe('reactive forms integration tests', () => { expect(form.controls['pin'].errors).toEqual({max: {max: 10, actual: 20}}); }); - it('should run min/max validation for negative values', () => { + it(`should run min/max validation for negative values for ${dir}`, () => { const fixture = initTest(getComponent(dir)); const control = new FormControl(-30); fixture.componentInstance.control = control; @@ -5485,7 +5485,7 @@ describe('reactive forms integration tests', () => { }); }); - it('should clean up when FormArrayName is destroyed (but parent FormGroup exists)', () => { + it('should clean up when FormArrayName is destroyed (but parent FormGroup exists, ngIf on formArrayName)', () => { // Scenario: // --------- // [formGroup] @@ -5610,7 +5610,7 @@ describe('reactive forms integration tests', () => { }); }); - it('should clean up all child controls when FormGroup is destroyed', () => { + it('should clean up all child controls (formArrayName) when FormGroup is destroyed', () => { // Scenario: // --------- // [formGroup] *ngIf @@ -5985,7 +5985,7 @@ describe('reactive forms integration tests', () => { }); }); - it('should clean up all child controls when FormGroup is destroyed', () => { + it('should clean up all child controls (formGroupName) when FormGroup is destroyed', () => { // Scenario: // --------- // [formGroup] *ngIf diff --git a/packages/forms/test/validators_spec.ts b/packages/forms/test/validators_spec.ts index 5ac03f98597..54295d1c788 100644 --- a/packages/forms/test/validators_spec.ts +++ b/packages/forms/test/validators_spec.ts @@ -6,6 +6,8 @@ * found in the LICENSE file at https://angular.dev/license */ +import {Observable, of, timer} from 'rxjs'; +import {first, map} from 'rxjs/operators'; import { AbstractControl, AsyncValidator, @@ -16,8 +18,6 @@ import { ValidatorFn, Validators, } from '../index'; -import {Observable, of, timer} from 'rxjs'; -import {first, map} from 'rxjs/operators'; import {normalizeValidators} from '../src/validators'; import {timeout, useAutoTick} from './util'; @@ -140,17 +140,17 @@ import {timeout, useAutoTick} from './util'; expect(Validators.max(1.25)(new FormControl(1.25))).toBeNull(); }); - it('should return a validation error on big values', () => { + it('should return a max validation error on decimal values', () => { expect(Validators.max(1.25)(new FormControl(1.3))).toEqual({ 'max': {'max': 1.25, 'actual': 1.3}, }); }); - it('should return a validation error on big values', () => { + it('should return a max validation error on integer', () => { expect(Validators.max(2)(new FormControl(3))).toEqual({'max': {'max': 2, 'actual': 3}}); }); - it('should return a validation error on big values converted from strings', () => { + it('should return a max validation error values converted from strings', () => { expect(Validators.max(2)(new FormControl('3'))).toEqual({'max': {'max': 2, 'actual': '3'}}); }); @@ -318,11 +318,6 @@ import {timeout, useAutoTick} from './util'; const value = new Set(); expect(Validators.minLength(1)(new FormControl(value))).toBeNull(); }); - - it('should return null when passing a boolean', () => { - expect(Validators.minLength(1)(new FormControl(true))).toBeNull(); - expect(Validators.minLength(1)(new FormControl(false))).toBeNull(); - }); }); describe('maxLength', () => { @@ -375,14 +370,6 @@ import {timeout, useAutoTick} from './util'; }); }); - it('should trigger validation for an object that contains numeric length property', () => { - const value = {length: 5, someValue: [1, 2, 3, 4, 5]}; - expect(Validators.maxLength(10)(new FormControl(value))).toBeNull(); - expect(Validators.maxLength(1)(new FormControl(value))).toEqual({ - 'maxlength': {'requiredLength': 1, 'actualLength': 5}, - }); - }); - it('should trigger validation for an object that contains numeric size property', () => { const value = new Set([1, 2, 3, 4, 5]); expect(Validators.maxLength(10)(new FormControl(value))).toBeNull(); diff --git a/packages/language-service/test/definitions_spec.ts b/packages/language-service/test/definitions_spec.ts index 7f46142157c..8a50129b7ea 100644 --- a/packages/language-service/test/definitions_spec.ts +++ b/packages/language-service/test/definitions_spec.ts @@ -1004,12 +1004,9 @@ describe('definitions', () => { expect(definitions).toBeTruthy(); return {textSpan, definitions: definitions!.map((d) => humanizeDocumentSpanLike(d, env))}; } -}); - -describe('definitions', () => { - let env: LanguageServiceTestEnv; describe('when an input has a dollar sign', () => { + let env: LanguageServiceTestEnv; const files = { 'app.ts': ` import {Component, NgModule, Input} from '@angular/core'; @@ -1042,7 +1039,12 @@ describe('definitions', () => { it('can get definitions for input', () => { const project = env.addProject('test', files, {strictTemplates: false}); - const definitions = getDefinitionsAndAssertBoundSpan(project, 'app.ts', '[o¦bs$]="greeting"'); + const definitions = getDefinitionsAndAssertBoundSpanFromProject( + project, + 'app.ts', + '[o¦bs$]="greeting"', + env, + ); expect(definitions!.length).toEqual(1); assertTextSpans(definitions, ['obs$']); @@ -1051,7 +1053,12 @@ describe('definitions', () => { it('can get definitions for component', () => { const project = env.addProject('test', files, {strictTemplates: false}); - const definitions = getDefinitionsAndAssertBoundSpan(project, 'app.ts', ' { }); describe('when a selector and input of a directive have a dollar sign', () => { + let env: LanguageServiceTestEnv; it('can get definitions', () => { initMockFileSystem('Native'); env = LanguageServiceTestEnv.setup(); @@ -1088,10 +1096,11 @@ describe('definitions', () => { `, }; const project = env.addProject('test', files, {strictTemplates: false}); - const definitions = getDefinitionsAndAssertBoundSpan( + const definitions = getDefinitionsAndAssertBoundSpanFromProject( project, 'app.ts', '[dollar¦$]="greeting"', + env, ); expect(definitions!.length).toEqual(2); @@ -1100,7 +1109,12 @@ describe('definitions', () => { }); }); - function getDefinitionsAndAssertBoundSpan(project: Project, file: string, targetText: string) { + function getDefinitionsAndAssertBoundSpanFromProject( + project: Project, + file: string, + targetText: string, + env: LanguageServiceTestEnv, + ) { const template = project.openFile(file); env.expectNoSourceDiagnostics(); project.expectNoTemplateDiagnostics('app.ts', 'AppCmp'); diff --git a/packages/language-service/test/get_template_location_for_component_spec.ts b/packages/language-service/test/get_template_location_for_component_spec.ts index e89c04f157c..0692511557d 100644 --- a/packages/language-service/test/get_template_location_for_component_spec.ts +++ b/packages/language-service/test/get_template_location_for_component_spec.ts @@ -103,7 +103,7 @@ describe('get template location for component', () => { assertFileNames([result2], ['template2.html']); }); - it('returns nothing when cursor is not in a component', () => { + it('returns nothing when cursor is not in a component (directive)', () => { const files = { 'app.ts': ` import {Directive} from '@angular/core'; @@ -124,7 +124,7 @@ describe('get template location for component', () => { expect(appFile.getTemplateLocationForComponent()).toBeUndefined(); }); - it('returns nothing when cursor is not in a component', () => { + it('returns nothing when cursor is not in a component (external const)', () => { const files = { 'app.ts': ` import {Component} from '@angular/core'; diff --git a/packages/language-service/test/legacy/template_target_spec.ts b/packages/language-service/test/legacy/template_target_spec.ts index e64ac2e2f5e..e6be3e8ca51 100644 --- a/packages/language-service/test/legacy/template_target_spec.ts +++ b/packages/language-service/test/legacy/template_target_spec.ts @@ -7,42 +7,42 @@ */ import { + Binary, + BindingPipe, + TmplAstBoundAttribute as BoundAttribute, + TmplAstBoundEvent as BoundEvent, + Call, + TmplAstComponent as Component, + Conditional, + TmplAstContent as Content, + TmplAstDeferredBlockError as DeferredBlockError, + TmplAstDeferredBlockLoading as DeferredBlockLoading, + TmplAstDeferredBlockPlaceholder as DeferredBlockPlaceholder, + TmplAstDirective as Directive, + TmplAstElement as Element, + EmptyExpr, + TmplAstForLoopBlock as ForLoopBlock, + TmplAstForLoopBlockEmpty as ForLoopBlockEmpty, + TmplAstIfBlockBranch as IfBlockBranch, + KeyedRead, + TmplAstLetDeclaration as LetDeclaration, + LiteralArray, + LiteralMap, + LiteralPrimitive, + TmplAstNode as Node, ParseError, parseTemplate, PropertyRead, - SafePropertyRead, - SafeKeyedRead, - KeyedRead, - Binary, - BindingPipe, - SafeCall, - Call, - EmptyExpr, - LiteralArray, - LiteralMap, - Conditional, - LiteralPrimitive, - TmplAstNode as Node, - TmplAstBoundEvent as BoundEvent, - TmplAstTextAttribute as TextAttribute, - TmplAstVariable as Variable, - TmplAstBoundAttribute as BoundAttribute, - TmplAstElement as Element, - TmplAstTimerDeferredTrigger as TimerDeferredTrigger, TmplAstReference as Reference, - TmplAstTemplate as Template, - TmplAstLetDeclaration as LetDeclaration, - TmplAstContent as Content, - TmplAstComponent as Component, - TmplAstDirective as Directive, + SafeCall, + SafeKeyedRead, + SafePropertyRead, TmplAstSwitchBlock as SwitchBlock, TmplAstSwitchBlockCase as SwitchBlockCase, - TmplAstIfBlockBranch as IfBlockBranch, - TmplAstForLoopBlock as ForLoopBlock, - TmplAstForLoopBlockEmpty as ForLoopBlockEmpty, - TmplAstDeferredBlockError as DeferredBlockError, - TmplAstDeferredBlockPlaceholder as DeferredBlockPlaceholder, - TmplAstDeferredBlockLoading as DeferredBlockLoading, + TmplAstTemplate as Template, + TmplAstTextAttribute as TextAttribute, + TmplAstTimerDeferredTrigger as TimerDeferredTrigger, + TmplAstVariable as Variable, } from '@angular/compiler'; import { @@ -611,9 +611,7 @@ describe('getTargetAtPosition for expression AST', () => { const {node} = context as SingleNodeTarget; expect(isExpressionNode(node!)).toBe(true); expect(node).toBeInstanceOf(BindingPipe); - }); - it('should locate binding pipe without identifier', () => { // TODO: We are not able to locate pipe if identifier is missing because the // parser throws an error. This case is important for autocomplete. // const {errors, nodes, position} = parse(`{{ title | ¦ }}`); diff --git a/packages/language-service/test/references_and_rename_spec.ts b/packages/language-service/test/references_and_rename_spec.ts index cfd032a4a93..bd5fb710c23 100644 --- a/packages/language-service/test/references_and_rename_spec.ts +++ b/packages/language-service/test/references_and_rename_spec.ts @@ -822,7 +822,7 @@ describe('find references and rename locations', () => { }); }); - describe('when cursor is on property read of variable', () => { + describe('when cursor is on property read of variable (inside listener callback)', () => { let file: OpenBuffer; beforeEach(() => { const files = { diff --git a/packages/language-service/test/ts_utils_spec.ts b/packages/language-service/test/ts_utils_spec.ts index 0833ab48083..667ee4373cb 100644 --- a/packages/language-service/test/ts_utils_spec.ts +++ b/packages/language-service/test/ts_utils_spec.ts @@ -15,10 +15,8 @@ import { ensureArrayWithIdentifier, findTightestNode, generateImport, - hasImport, nonCollidingImportName, objectPropertyAssignmentForKey, - printNode, updateImport, updateObjectValueForKey, } from '../src/utils/ts_utils'; @@ -131,6 +129,12 @@ describe('TS util', () => { const newArr = addElementToArrayLiteral(oldArr, ts.factory.createStringLiteral('b')); expect(print(newArr)).toEqual('["a", "b"]'); }); + + it('addElementToArrayLiteral', () => { + let arr = ensureArrayWithIdentifier('foo', ts.factory.createIdentifier('foo')); + arr = addElementToArrayLiteral(arr!, ts.factory.createIdentifier('bar')); + expect(print(arr)).toEqual('[foo, bar]'); + }); }); describe('objectPropertyAssignmentForKey', () => { @@ -191,12 +195,6 @@ describe('TS util', () => { }); }); - it('addElementToArrayLiteral', () => { - let arr = ensureArrayWithIdentifier('foo', ts.factory.createIdentifier('foo')); - arr = addElementToArrayLiteral(arr!, ts.factory.createIdentifier('bar')); - expect(print(arr)).toEqual('[foo, bar]'); - }); - it('ensureArrayWithIdentifier', () => { let arr = ensureArrayWithIdentifier('foo', ts.factory.createIdentifier('foo')); expect(print(arr!)).toEqual('[foo]'); diff --git a/packages/localize/tools/test/BUILD.bazel b/packages/localize/tools/test/BUILD.bazel index ab14bc08f4a..4c733ff9815 100644 --- a/packages/localize/tools/test/BUILD.bazel +++ b/packages/localize/tools/test/BUILD.bazel @@ -31,4 +31,5 @@ jasmine_test( ":test_lib", "//:node_modules/tinyglobby", ], + shard_count = 4, ) diff --git a/packages/localize/tools/test/extract/extractor_spec.ts b/packages/localize/tools/test/extract/extractor_spec.ts index e21d0eafb4c..dbdd8462927 100644 --- a/packages/localize/tools/test/extract/extractor_spec.ts +++ b/packages/localize/tools/test/extract/extractor_spec.ts @@ -11,8 +11,8 @@ import {MockLogger} from '@angular/compiler-cli/src/ngtsc/logging/testing'; import {MessageExtractor} from '../../src/extract/extraction'; import {runInNativeFileSystem} from '../helpers'; -runInNativeFileSystem(() => { - describe('extractMessages', () => { +runInNativeFileSystem('extractMessages', () => { + describe('', () => { it('should extract a message for each $localize template tag', () => { const fs = getFileSystem(); const logger = new MockLogger(); diff --git a/packages/localize/tools/test/extract/integration/main_spec.ts b/packages/localize/tools/test/extract/integration/main_spec.ts index a80b8de213a..293e3fd3db9 100644 --- a/packages/localize/tools/test/extract/integration/main_spec.ts +++ b/packages/localize/tools/test/extract/integration/main_spec.ts @@ -10,8 +10,8 @@ import { AbsoluteFsPath, FileSystem, getFileSystem, - setFileSystem, InvalidFileSystem, + setFileSystem, } from '@angular/compiler-cli/src/ngtsc/file_system'; import {MockLogger} from '@angular/compiler-cli/src/ngtsc/logging/testing'; import {loadTestDirectory} from '@angular/compiler-cli/src/ngtsc/testing'; @@ -25,7 +25,7 @@ import {toAttributes} from '../translation_files/utils'; const currentDir = path.dirname(url.fileURLToPath(import.meta.url)); -runInNativeFileSystem(() => { +runInNativeFileSystem('extractTranslations()', () => { let fs: FileSystem; let logger: MockLogger; let rootPath: AbsoluteFsPath; @@ -48,7 +48,7 @@ runInNativeFileSystem(() => { setFileSystem(new InvalidFileSystem()); }); - describe('extractTranslations()', () => { + describe('', () => { it('should ignore non-code files', () => { extractTranslations({ rootPath, @@ -311,7 +311,7 @@ runInNativeFileSystem(() => { ); }); - it('should extract translations from source code, and write as XLIFF 2 format', () => { + it(`should extract translations from source code, and write as XLIFF 2 format (${JSON.stringify(formatOptions)})`, () => { extractTranslations({ rootPath, sourceLocale: 'en-AU', diff --git a/packages/localize/tools/test/extract/source_files/es5_extract_plugin_spec.ts b/packages/localize/tools/test/extract/source_files/es5_extract_plugin_spec.ts index 297aafef7d7..a93fb5764bf 100644 --- a/packages/localize/tools/test/extract/source_files/es5_extract_plugin_spec.ts +++ b/packages/localize/tools/test/extract/source_files/es5_extract_plugin_spec.ts @@ -11,13 +11,13 @@ import { PathSegment, relativeFrom, } from '@angular/compiler-cli/src/ngtsc/file_system'; -import {ɵParsedMessage} from '../../../../private'; import {transformSync} from '@babel/core'; +import {ɵParsedMessage} from '../../../../private'; import {makeEs5ExtractPlugin} from '../../../src/extract/source_files/es5_extract_plugin'; import {runInNativeFileSystem} from '../../helpers'; -runInNativeFileSystem(() => { +runInNativeFileSystem('makeEs5ExtractPlugin()', () => { let fs: FileSystem; let testPath: PathSegment; @@ -26,7 +26,7 @@ runInNativeFileSystem(() => { testPath = relativeFrom('app/dist/test.js'); }); - describe('makeEs5ExtractPlugin()', () => { + describe('', () => { it('should error with code-frame information if the first argument to `$localize` is not an array', () => { const input = '$localize(null, [])'; expect(() => transformCode(input)).toThrowError( diff --git a/packages/localize/tools/test/extract/translation_files/xliff1_translation_serializer_spec.ts b/packages/localize/tools/test/extract/translation_files/xliff1_translation_serializer_spec.ts index bc13cbfe146..9e3132582bf 100644 --- a/packages/localize/tools/test/extract/translation_files/xliff1_translation_serializer_spec.ts +++ b/packages/localize/tools/test/extract/translation_files/xliff1_translation_serializer_spec.ts @@ -19,7 +19,7 @@ runInEachFileSystem(() => { describe('Xliff1TranslationSerializer', () => { ([{}, {'xml:space': 'preserve'}] as FormatOptions[]).forEach((options) => { [false, true].forEach((useLegacyIds) => { - describe(`renderFile() [using ${useLegacyIds ? 'legacy' : 'canonical'} ids]`, () => { + describe(`renderFile() [using ${useLegacyIds ? 'legacy' : 'canonical'} ids] with option:${JSON.stringify(options)}`, () => { it('should convert a set of parsed messages into an XML string', () => { const phLocation: ɵSourceLocation = { start: {line: 0, column: 10}, @@ -151,7 +151,7 @@ runInEachFileSystem(() => { ); }); - it('should convert a set of parsed messages into an XML string', () => { + it('should merge messages with the same id', () => { const messageLocation1: ɵSourceLocation = { start: {line: 0, column: 5}, end: {line: 0, column: 10}, diff --git a/packages/localize/tools/test/extract/translation_files/xliff2_translation_serializer_spec.ts b/packages/localize/tools/test/extract/translation_files/xliff2_translation_serializer_spec.ts index 402663858a6..a8800cda7fd 100644 --- a/packages/localize/tools/test/extract/translation_files/xliff2_translation_serializer_spec.ts +++ b/packages/localize/tools/test/extract/translation_files/xliff2_translation_serializer_spec.ts @@ -19,7 +19,7 @@ runInEachFileSystem(() => { describe('Xliff2TranslationSerializer', () => { ([{}, {'xml:space': 'preserve'}] as FormatOptions[]).forEach((options) => { [false, true].forEach((useLegacyIds) => { - describe(`renderFile() [using ${useLegacyIds ? 'legacy' : 'canonical'} ids]`, () => { + describe(`renderFile() [using ${useLegacyIds ? 'legacy' : 'canonical'} ids] with options:${JSON.stringify(options)}`, () => { it('should convert a set of parsed messages into an XML string', () => { const phLocation: ɵSourceLocation = { start: {line: 0, column: 10}, @@ -174,7 +174,7 @@ runInEachFileSystem(() => { ]); }); - it('should convert a set of parsed messages into an XML string', () => { + it('should merge messages with the same id', () => { const messageLocation1: ɵSourceLocation = { start: {line: 0, column: 5}, end: {line: 0, column: 10}, diff --git a/packages/localize/tools/test/helpers/index.ts b/packages/localize/tools/test/helpers/index.ts index ab307498083..93334c72784 100644 --- a/packages/localize/tools/test/helpers/index.ts +++ b/packages/localize/tools/test/helpers/index.ts @@ -5,7 +5,7 @@ * Use of this source code is governed by an MIT-style license that can be * found in the LICENSE file at https://angular.dev/license */ -import {setFileSystem, InvalidFileSystem} from '@angular/compiler-cli/src/ngtsc/file_system'; +import {InvalidFileSystem, setFileSystem} from '@angular/compiler-cli/src/ngtsc/file_system'; import {MockFileSystemNative} from '@angular/compiler-cli/src/ngtsc/file_system/testing'; /** @@ -15,8 +15,9 @@ import {MockFileSystemNative} from '@angular/compiler-cli/src/ngtsc/file_system/ * file-system from the outside. We run these tests on Unix and Windows in our CI jobs, so there is * test coverage. */ -export function runInNativeFileSystem(callback: () => void) { - describe(`<>`, () => { +let counter = 0; +export function runInNativeFileSystem(label: string, callback: () => void) { + describe(`<>/${label}`, () => { beforeEach(() => setFileSystem(new MockFileSystemNative())); afterEach(() => setFileSystem(new InvalidFileSystem())); callback(); diff --git a/packages/localize/tools/test/migrate/integration/main_spec.ts b/packages/localize/tools/test/migrate/integration/main_spec.ts index 64101285b47..a14f953ffa2 100644 --- a/packages/localize/tools/test/migrate/integration/main_spec.ts +++ b/packages/localize/tools/test/migrate/integration/main_spec.ts @@ -22,7 +22,7 @@ import {runInNativeFileSystem} from '../../helpers'; const currentDir = path.dirname(url.fileURLToPath(import.meta.url)); -runInNativeFileSystem(() => { +runInNativeFileSystem('migrateFiles()', () => { let fs: FileSystem; let logger: MockLogger; let rootPath: AbsoluteFsPath; @@ -37,7 +37,7 @@ runInNativeFileSystem(() => { loadTestDirectory(fs, path.join(currentDir, 'test_files'), absoluteFrom('/project/test_files')); }); - describe('migrateFiles()', () => { + describe('', () => { it('should log a warning if the migration file is empty', () => { const emptyMappingPath = fs.resolve(rootPath, 'test_files/empty-mapping.json'); migrateFiles({ diff --git a/packages/localize/tools/test/source_file_utils_spec.ts b/packages/localize/tools/test/source_file_utils_spec.ts index 75e56ec3355..3fb1c3c6aee 100644 --- a/packages/localize/tools/test/source_file_utils_spec.ts +++ b/packages/localize/tools/test/source_file_utils_spec.ts @@ -10,9 +10,9 @@ import { getFileSystem, PathManipulation, } from '@angular/compiler-cli/src/ngtsc/file_system'; -import {ɵmakeTemplateObject} from '../../index'; -import babel, {NodePath, TransformOptions, template, types as t} from '@babel/core'; +import babel, {NodePath, types as t, template, TransformOptions} from '@babel/core'; import _generate from '@babel/generator'; +import {ɵmakeTemplateObject} from '../../index'; // Babel is a CJS package and misuses the `default` named binding: // https://github.com/babel/babel/issues/15269. @@ -34,10 +34,10 @@ import { import {runInNativeFileSystem} from './helpers'; -runInNativeFileSystem(() => { +runInNativeFileSystem('utils', () => { let fs: PathManipulation; beforeEach(() => (fs = getFileSystem())); - describe('utils', () => { + describe('', () => { describe('isNamedIdentifier()', () => { it('should return true if the expression is an identifier with name `$localize`', () => { const taggedTemplate = getTaggedTemplate('$localize ``;'); diff --git a/packages/localize/tools/test/translate/integration/main_spec.ts b/packages/localize/tools/test/translate/integration/main_spec.ts index a537e5a21cb..d248ce8f3cc 100644 --- a/packages/localize/tools/test/translate/integration/main_spec.ts +++ b/packages/localize/tools/test/translate/integration/main_spec.ts @@ -22,8 +22,8 @@ import {runInNativeFileSystem} from '../../helpers'; const currentDir = path.dirname(url.fileURLToPath(import.meta.url)); -runInNativeFileSystem(() => { - describe('translateFiles()', () => { +runInNativeFileSystem('translateFiles()', () => { + describe('', () => { let fs: FileSystem; let testDir: AbsoluteFsPath; let testFilesDir: AbsoluteFsPath; diff --git a/packages/localize/tools/test/translate/source_files/es2015_translate_plugin_spec.ts b/packages/localize/tools/test/translate/source_files/es2015_translate_plugin_spec.ts index 8a88f48ac8f..75f888f9d02 100644 --- a/packages/localize/tools/test/translate/source_files/es2015_translate_plugin_spec.ts +++ b/packages/localize/tools/test/translate/source_files/es2015_translate_plugin_spec.ts @@ -6,16 +6,16 @@ * found in the LICENSE file at https://angular.dev/license */ import {FileSystem, getFileSystem} from '@angular/compiler-cli/src/ngtsc/file_system'; +import {transformSync} from '@babel/core'; import {ɵcomputeMsgId, ɵparseTranslation} from '../../../../index'; import {ɵParsedTranslation} from '../../../../private'; -import {transformSync} from '@babel/core'; import {Diagnostics} from '../../../src/diagnostics'; import {TranslatePluginOptions} from '../../../src/source_file_utils'; import {makeEs2015TranslatePlugin} from '../../../src/translate/source_files/es2015_translate_plugin'; import {runInNativeFileSystem} from '../../helpers'; -runInNativeFileSystem(() => { +runInNativeFileSystem('makeEs2015Plugin', () => { let fs: FileSystem; beforeEach(() => { diff --git a/packages/localize/tools/test/translate/source_files/es5_translate_plugin_spec.ts b/packages/localize/tools/test/translate/source_files/es5_translate_plugin_spec.ts index bb32ba82a24..f683fe6081a 100644 --- a/packages/localize/tools/test/translate/source_files/es5_translate_plugin_spec.ts +++ b/packages/localize/tools/test/translate/source_files/es5_translate_plugin_spec.ts @@ -11,16 +11,16 @@ import { PathSegment, relativeFrom, } from '@angular/compiler-cli/src/ngtsc/file_system'; +import {transformSync} from '@babel/core'; import {ɵcomputeMsgId, ɵparseTranslation} from '../../../../index'; import {ɵParsedTranslation} from '../../../../private'; -import {transformSync} from '@babel/core'; import {Diagnostics} from '../../../src/diagnostics'; import {TranslatePluginOptions} from '../../../src/source_file_utils'; import {makeEs5TranslatePlugin} from '../../../src/translate/source_files/es5_translate_plugin'; import {runInNativeFileSystem} from '../../helpers'; -runInNativeFileSystem(() => { +runInNativeFileSystem('source_files', () => { let fs: FileSystem; let testPath: PathSegment; diff --git a/packages/localize/tools/test/translate/translation_files/translation_parsers/simple_json_spec.ts b/packages/localize/tools/test/translate/translation_files/translation_parsers/simple_json_spec.ts index ee6a0a73f10..625dc595b21 100644 --- a/packages/localize/tools/test/translate/translation_files/translation_parsers/simple_json_spec.ts +++ b/packages/localize/tools/test/translate/translation_files/translation_parsers/simple_json_spec.ts @@ -22,9 +22,7 @@ describe('SimpleJsonTranslationParser', () => { parser.analyze('/some/file.json', '{ "locale" : "fr", "translations" : {}}').canParse, ).toBeTrue(); }); - }); - describe('analyze()', () => { it('should return a success object if the file extension is `.json` and contains top level `locale` and `translations` properties', () => { const parser = new SimpleJsonTranslationParser(); expect(parser.analyze('/some/file.json', '{ "locale" : "fr", "translations" : {}}')).toEqual( diff --git a/packages/localize/tools/test/translate/translation_files/translation_parsers/xliff1_translation_parser_spec.ts b/packages/localize/tools/test/translate/translation_files/translation_parsers/xliff1_translation_parser_spec.ts index a8fcc18d3d1..80063d9fb62 100644 --- a/packages/localize/tools/test/translate/translation_files/translation_parsers/xliff1_translation_parser_spec.ts +++ b/packages/localize/tools/test/translate/translation_files/translation_parsers/xliff1_translation_parser_spec.ts @@ -36,9 +36,7 @@ describe('Xliff1TranslationParser', () => { expect(parser.analyze('/some/file.xlf', '').canParse).toBeFalse(); expect(parser.analyze('/some/file.json', '').canParse).toBeFalse(); }); - }); - describe('analyze()', () => { it('should return a success object if the file contains an element with version="1.2" attribute', () => { const parser = new Xliff1TranslationParser(); expect(parser.analyze('/some/file.xlf', '')).toEqual( diff --git a/packages/localize/tools/test/translate/translation_files/translation_parsers/xtb_translation_parser_spec.ts b/packages/localize/tools/test/translate/translation_files/translation_parsers/xtb_translation_parser_spec.ts index 06f4686a011..1fd98da27a6 100644 --- a/packages/localize/tools/test/translate/translation_files/translation_parsers/xtb_translation_parser_spec.ts +++ b/packages/localize/tools/test/translate/translation_files/translation_parsers/xtb_translation_parser_spec.ts @@ -25,9 +25,7 @@ describe('XtbTranslationParser', () => { expect(parser.analyze('/some/file.xmb', '').canParse).toBeFalse(); expect(parser.analyze('/some/file.xtb', '').canParse).toBeFalse(); }); - }); - describe('analyze()', () => { it('should return a success object if the file extension is `.xtb` or `.xmb` and it contains the `` tag', () => { const parser = new XtbTranslationParser(); expect(parser.analyze('/some/file.xtb', '')).toEqual( diff --git a/packages/platform-browser/test/browser/meta_spec.ts b/packages/platform-browser/test/browser/meta_spec.ts index 3a4bab9eb93..91d0809f6b8 100644 --- a/packages/platform-browser/test/browser/meta_spec.ts +++ b/packages/platform-browser/test/browser/meta_spec.ts @@ -9,8 +9,8 @@ import {ɵgetDOM as getDOM} from '@angular/common'; import {Injectable} from '@angular/core'; import {TestBed} from '@angular/core/testing'; -import {BrowserModule, Meta} from '../../index'; import {expect} from '@angular/private/testing/matchers'; +import {BrowserModule, Meta} from '../../index'; describe('Meta service', () => { let doc: Document; @@ -198,21 +198,21 @@ describe('Meta service', () => { // clean up metaService.removeTagElement(meta); }); -}); -describe('integration test', () => { - @Injectable() - class DependsOnMeta { - constructor(public meta: Meta) {} - } + describe('integration test', () => { + @Injectable() + class DependsOnMeta { + constructor(public meta: Meta) {} + } - beforeEach(() => { - TestBed.configureTestingModule({ - imports: [BrowserModule], - providers: [DependsOnMeta], + beforeEach(() => { + TestBed.configureTestingModule({ + imports: [BrowserModule], + providers: [DependsOnMeta], + }); }); - }); - it('should inject Meta service when using BrowserModule', () => - expect(TestBed.inject(DependsOnMeta).meta).toBeInstanceOf(Meta)); + it('should inject Meta service when using BrowserModule', () => + expect(TestBed.inject(DependsOnMeta).meta).toBeInstanceOf(Meta)); + }); }); diff --git a/packages/platform-browser/test/browser/title_spec.ts b/packages/platform-browser/test/browser/title_spec.ts index 4c79d343621..be403755f3b 100644 --- a/packages/platform-browser/test/browser/title_spec.ts +++ b/packages/platform-browser/test/browser/title_spec.ts @@ -9,8 +9,8 @@ import {ɵgetDOM as getDOM} from '@angular/common'; import {Injectable} from '@angular/core'; import {TestBed} from '@angular/core/testing'; -import {BrowserModule, Title} from '../../index'; import {expect} from '@angular/private/testing/matchers'; +import {BrowserModule, Title} from '../../index'; describe('title service', () => { let doc: Document; @@ -41,22 +41,22 @@ describe('title service', () => { titleService.setTitle(null!); expect(doc.title).toEqual(''); }); -}); -describe('integration test', () => { - @Injectable() - class DependsOnTitle { - constructor(public title: Title) {} - } + describe('integration test', () => { + @Injectable() + class DependsOnTitle { + constructor(public title: Title) {} + } - beforeEach(() => { - TestBed.configureTestingModule({ - imports: [BrowserModule], - providers: [DependsOnTitle], + beforeEach(() => { + TestBed.configureTestingModule({ + imports: [BrowserModule], + providers: [DependsOnTitle], + }); + }); + + it('should inject Title service when using BrowserModule', () => { + expect(TestBed.inject(DependsOnTitle).title).toBeInstanceOf(Title); }); }); - - it('should inject Title service when using BrowserModule', () => { - expect(TestBed.inject(DependsOnTitle).title).toBeInstanceOf(Title); - }); }); diff --git a/packages/platform-server/test/full_app_hydration_spec.ts b/packages/platform-server/test/full_app_hydration_spec.ts index 3979b43951c..1c70be62f08 100644 --- a/packages/platform-server/test/full_app_hydration_spec.ts +++ b/packages/platform-server/test/full_app_hydration_spec.ts @@ -27,12 +27,13 @@ import { afterEveryRender, ApplicationRef, ChangeDetectorRef, + ɵCLIENT_RENDER_MODE_FLAG as CLIENT_RENDER_MODE_FLAG, Component, + ContentChild, ContentChildren, createComponent, destroyPlatform, Directive, - ɵCLIENT_RENDER_MODE_FLAG as CLIENT_RENDER_MODE_FLAG, ElementRef, EnvironmentInjector, ErrorHandler, @@ -43,16 +44,14 @@ import { Pipe, PipeTransform, PLATFORM_ID, - provideZonelessChangeDetection, Provider, + provideZoneChangeDetection, + provideZonelessChangeDetection, QueryList, TemplateRef, ViewChild, ViewContainerRef, ViewEncapsulation, - ɵNoopNgZone as NoopNgZone, - ContentChild, - provideZoneChangeDetection, } from '@angular/core'; import {TestBed} from '@angular/core/testing'; import {clearTranslations, loadTranslations} from '@angular/localize'; @@ -1257,7 +1256,7 @@ describe('platform-server full application hydration integration', () => { verifyClientAndSSRContentsMatch(ssrContents, clientRootNode); }); - it('should hydrate dynamically created components using root component as an anchor', async () => { + it('should hydrate dynamically created components using root component as an anchor (with nested components)', async () => { @Component({ imports: [CommonModule], selector: 'nested-dynamic-a', @@ -5233,7 +5232,7 @@ describe('platform-server full application hydration integration', () => { ); describe('partial projection', () => { - it('should support cases when some element nodes are not projected', async () => { + it('should support cases when some element nodes are not projected (ng-content)', async () => { @Component({ selector: 'projector-cmp', template: ` @@ -5278,7 +5277,7 @@ describe('platform-server full application hydration integration', () => { verifyClientAndSSRContentsMatch(ssrContents, clientRootNode); }); - it('should support cases when some element nodes are not projected', async () => { + it('should support cases when some element nodes are not projected (@if)', async () => { @Component({ selector: 'app-dropdown-content', template: ``, diff --git a/packages/platform-server/test/integration_spec.ts b/packages/platform-server/test/integration_spec.ts index 49f0a9a3384..9899e74dd50 100644 --- a/packages/platform-server/test/integration_spec.ts +++ b/packages/platform-server/test/integration_spec.ts @@ -8,7 +8,7 @@ import '@angular/compiler'; import {animate, AnimationBuilder, state, style, transition, trigger} from '@angular/animations'; -import {DOCUMENT, isPlatformServer, PlatformLocation, ɵgetDOM as getDOM} from '@angular/common'; +import {DOCUMENT, ɵgetDOM as getDOM, isPlatformServer, PlatformLocation} from '@angular/common'; import { HTTP_INTERCEPTORS, HttpClient, @@ -20,14 +20,17 @@ import { } from '@angular/common/http'; import {HttpClientTestingModule, HttpTestingController} from '@angular/common/http/testing'; import { + APP_INITIALIZER, ApplicationConfig, ApplicationRef, Component, + inject as coreInject, destroyPlatform, EnvironmentProviders, + getPlatform, HostListener, Inject, - inject as coreInject, + inject, Injectable, Input, makeStateKey, @@ -35,29 +38,27 @@ import { NgModule, NgModuleRef, NgZone, + PendingTasks, PLATFORM_ID, + provideNgReflectAttributes, Provider, + provideZoneChangeDetection, + ɵSSR_CONTENT_INTEGRITY_MARKER as SSR_CONTENT_INTEGRITY_MARKER, TransferState, Type, ViewEncapsulation, - PendingTasks, - APP_INITIALIZER, - inject, - getPlatform, - provideNgReflectAttributes, - ɵSSR_CONTENT_INTEGRITY_MARKER as SSR_CONTENT_INTEGRITY_MARKER, - provideZoneChangeDetection, - signal, } from '@angular/core'; import {TestBed} from '@angular/core/testing'; import { bootstrapApplication, - createApplication, BootstrapContext, BrowserModule, + createApplication, provideClientHydration, Title, } from '@angular/platform-browser'; +import {provideRouter, RouterOutlet, Routes} from '@angular/router'; +import {Observable} from 'rxjs'; import { BEFORE_APP_SERIALIZED, INITIAL_CONFIG, @@ -67,11 +68,9 @@ import { renderModule, ServerModule, } from '../index'; -import {provideRouter, RouterOutlet, Routes} from '@angular/router'; -import {Observable} from 'rxjs'; -import {renderApplication, SERVER_CONTEXT} from '../src/utils'; import {BrowserAnimationsModule, provideAnimations} from '@angular/platform-browser/animations'; +import {renderApplication, SERVER_CONTEXT} from '../src/utils'; const APP_CONFIG: ApplicationConfig = { providers: [provideServerRendering()], @@ -848,7 +847,7 @@ class HiddenModule {} }, ); - it('works with SVG elements', async () => { + it(`works with SVG elements (standalone:${isStandalone})`, async () => { const options = {document: doc}; const bootstrap = isStandalone ? renderApplication(SVGComponentStandalone, {...options}) @@ -860,7 +859,7 @@ class HiddenModule {} ); }); - it('works with animation', async () => { + it('works with animation' + `(standalone:${isStandalone})`, async () => { const options = {document: doc}; const bootstrap = isStandalone ? renderApplication(MyAnimationAppStandalone, options) @@ -873,42 +872,49 @@ class HiddenModule {} expect(output).toContain('font-weight: bold;'); }); - it('should handle ViewEncapsulation.ShadowDom', async () => { - const options = {document: doc}; - const bootstrap = isStandalone - ? renderApplication(ShadowDomEncapsulationAppStandalone, options) - : renderModule(ShadowDomExampleModule, options); - const output = await bootstrap; - expect(output).not.toBe(''); - expect(output).toContain('color: red'); - }); + it( + 'should handle ViewEncapsulation.ShadowDom' + `(standalone:${isStandalone})`, + async () => { + const options = {document: doc}; + const bootstrap = isStandalone + ? renderApplication(ShadowDomEncapsulationAppStandalone, options) + : renderModule(ShadowDomExampleModule, options); + const output = await bootstrap; + expect(output).not.toBe(''); + expect(output).toContain('color: red'); + }, + ); - it('adds the `ng-server-context` attribute to host elements', async () => { - const options = { - document: doc, - }; - const providers = [ - { - provide: SERVER_CONTEXT, - useValue: 'ssg', - }, - ]; - const bootstrap = isStandalone - ? renderApplication(MyStylesAppStandalone, { - ...options, - platformProviders: providers, - }) - : renderModule(ExampleStylesModule, { - ...options, - extraProviders: providers, - }); - const output = await bootstrap; - expect(output).toMatch( - //, - ); - }); + it( + 'adds the `ng-server-context` attribute to host elements' + + `(standalone:${isStandalone})`, + async () => { + const options = { + document: doc, + }; + const providers = [ + { + provide: SERVER_CONTEXT, + useValue: 'ssg', + }, + ]; + const bootstrap = isStandalone + ? renderApplication(MyStylesAppStandalone, { + ...options, + platformProviders: providers, + }) + : renderModule(ExampleStylesModule, { + ...options, + extraProviders: providers, + }); + const output = await bootstrap; + expect(output).toMatch( + //, + ); + }, + ); - it('sanitizes the `serverContext` value', async () => { + it('sanitizes the `serverContext` value' + `(standalone:${isStandalone})`, async () => { const options = { document: doc, }; @@ -948,60 +954,71 @@ class HiddenModule {} }, ); - it('uses `other` as the `serverContext` value when all symbols are removed after sanitization', async () => { - const options = { - document: doc, - }; - const providers = [ - { - provide: SERVER_CONTEXT, - useValue: '!!! &&<>', - }, - ]; - const bootstrap = isStandalone - ? renderApplication(MyStylesAppStandalone, { - ...options, - platformProviders: providers, - }) - : renderModule(ExampleStylesModule, { - ...options, - extraProviders: providers, - }); - // All symbols other than [a-zA-Z0-9\-] are removed, - // the `other` is used as the default. - const output = await bootstrap; - expect(output).toMatch(/ng-server-context="other"/); - }); + it( + 'uses `other` as the `serverContext` value when all symbols are removed after sanitization' + + `(standalone:${isStandalone})`, + async () => { + const options = { + document: doc, + }; + const providers = [ + { + provide: SERVER_CONTEXT, + useValue: '!!! &&<>', + }, + ]; + const bootstrap = isStandalone + ? renderApplication(MyStylesAppStandalone, { + ...options, + platformProviders: providers, + }) + : renderModule(ExampleStylesModule, { + ...options, + extraProviders: providers, + }); + // All symbols other than [a-zA-Z0-9\-] are removed, + // the `other` is used as the default. + const output = await bootstrap; + expect(output).toMatch(/ng-server-context="other"/); + }, + ); - it('appends SSR integrity marker comment when hydration is enabled', async () => { - @Component({ - selector: 'app', - template: ``, - }) - class SimpleApp {} + it( + 'appends SSR integrity marker comment when hydration is enabled' + + `(standalone:${isStandalone})`, + async () => { + @Component({ + selector: 'app', + template: ``, + }) + class SimpleApp {} - const output = await renderApplication( - getStandaloneBootstrapFn(SimpleApp, [provideClientHydration()]), - {document: doc}, - ); + const output = await renderApplication( + getStandaloneBootstrapFn(SimpleApp, [provideClientHydration()]), + {document: doc}, + ); - // HttpClient cache and DOM hydration are enabled by default. - expect(output).toContain(``); - }); + // HttpClient cache and DOM hydration are enabled by default. + expect(output).toContain(``); + }, + ); - it('should handle false values on attributes', async () => { - const options = {document: doc}; - const bootstrap = isStandalone - ? renderApplication(MyHostComponentStandalone, options) - : renderModule(FalseAttributesModule, options); - const output = await bootstrap; - expect(output).toBe( - '' + - 'Works!', - ); - }); + it( + 'should handle false values on attributes' + `(standalone:${isStandalone})`, + async () => { + const options = {document: doc}; + const bootstrap = isStandalone + ? renderApplication(MyHostComponentStandalone, options) + : renderModule(FalseAttributesModule, options); + const output = await bootstrap; + expect(output).toBe( + '' + + 'Works!', + ); + }, + ); - it('should handle element property "name"', async () => { + it('should handle element property "name"' + `(standalone:${isStandalone})`, async () => { const options = {document: doc}; const bootstrap = isStandalone ? renderApplication(MyInputComponentStandalone, options) @@ -1013,23 +1030,26 @@ class HiddenModule {} ); }); - it('should work with sanitizer to handle "innerHTML"', async () => { - // Clear out any global states. These should be set when platform-server - // is initialized. - (global as any).Node = undefined; - (global as any).Document = undefined; - const options = {document: doc}; - const bootstrap = isStandalone - ? renderApplication(HTMLTypesAppStandalone, options) - : renderModule(HTMLTypesModule, options); - const output = await bootstrap; - expect(output).toBe( - '' + - '
foo bar
', - ); - }); + it( + 'should work with sanitizer to handle "innerHTML"' + `(standalone:${isStandalone})`, + async () => { + // Clear out any global states. These should be set when platform-server + // is initialized. + (global as any).Node = undefined; + (global as any).Document = undefined; + const options = {document: doc}; + const bootstrap = isStandalone + ? renderApplication(HTMLTypesAppStandalone, options) + : renderModule(HTMLTypesModule, options); + const output = await bootstrap; + expect(output).toBe( + '' + + '
foo bar
', + ); + }, + ); - it('should handle element property "hidden"', async () => { + it('should handle element property "hidden"' + `(standalone:${isStandalone})`, async () => { const options = {document: doc}; const bootstrap = isStandalone ? renderApplication(MyHiddenComponentStandalone, options) @@ -1041,7 +1061,7 @@ class HiddenModule {} ); }); - it('should call render hook', async () => { + it('should call render hook' + `(standalone:${isStandalone})`, async () => { const options = {document: doc}; const bootstrap = isStandalone ? renderApplication( @@ -1057,7 +1077,7 @@ class HiddenModule {} ); }); - it('should call multiple render hooks', async () => { + it('should call multiple render hooks' + `(standalone:${isStandalone})`, async () => { const consoleSpy = spyOn(console, 'warn'); const options = {document: doc}; const bootstrap = isStandalone @@ -1075,7 +1095,7 @@ class HiddenModule {} expect(consoleSpy).toHaveBeenCalled(); }); - it('should call async render hooks', async () => { + it('should call async render hooks' + `(standalone:${isStandalone})`, async () => { const options = {document: doc}; const bootstrap = isStandalone ? renderApplication( @@ -1091,23 +1111,26 @@ class HiddenModule {} ); }); - it('should call multiple async and sync render hooks', async () => { - const consoleSpy = spyOn(console, 'warn'); - const options = {document: doc}; - const bootstrap = isStandalone - ? renderApplication( - getStandaloneBootstrapFn(MyServerAppStandalone, AsyncMultiRenderHookProviders), - options, - ) - : renderModule(AsyncMultiRenderHookModule, options); - const output = await bootstrap; - // title should be added by the render hook. - expect(output).toBe( - 'AsyncRenderHook' + - 'Works!', - ); - expect(consoleSpy).toHaveBeenCalled(); - }); + it( + 'should call multiple async and sync render hooks' + `(standalone:${isStandalone})`, + async () => { + const consoleSpy = spyOn(console, 'warn'); + const options = {document: doc}; + const bootstrap = isStandalone + ? renderApplication( + getStandaloneBootstrapFn(MyServerAppStandalone, AsyncMultiRenderHookProviders), + options, + ) + : renderModule(AsyncMultiRenderHookModule, options); + const output = await bootstrap; + // title should be added by the render hook. + expect(output).toBe( + 'AsyncRenderHook' + + 'Works!', + ); + expect(consoleSpy).toHaveBeenCalled(); + }, + ); it( `should wait for InitialRenderPendingTasks before serializing ` + diff --git a/packages/router/test/config.spec.ts b/packages/router/test/config.spec.ts index 9402f6553ce..2d4466fa45c 100644 --- a/packages/router/test/config.spec.ts +++ b/packages/router/test/config.spec.ts @@ -112,7 +112,7 @@ describe('config', () => { }).toThrowError(); }); - it('should throw when component and redirectTo are used together', () => { + it('should throw when canActivate and redirectTo are used together', () => { expect(() => { validateConfig([{path: 'a', redirectTo: 'b', canActivate: []}]); }).toThrowError(); diff --git a/packages/router/test/integration/eager_url_update_strategy.spec.ts b/packages/router/test/integration/eager_url_update_strategy.spec.ts index 92ec31d9e83..b0a049fd4a8 100644 --- a/packages/router/test/integration/eager_url_update_strategy.spec.ts +++ b/packages/router/test/integration/eager_url_update_strategy.spec.ts @@ -6,32 +6,32 @@ * found in the LICENSE file at https://angular.dev/license */ -import {Injectable, inject} from '@angular/core'; import {Location} from '@angular/common'; +import {Injectable, inject} from '@angular/core'; import {TestBed} from '@angular/core/testing'; +import {expect} from '@angular/private/testing/matchers'; +import {of} from 'rxjs'; +import {mapTo, switchMap} from 'rxjs/operators'; import { DefaultUrlSerializer, + GuardsCheckStart, + Navigation, + NavigationStart, + Router, + RoutesRecognized, provideRouter, withRouterConfig, - Router, - GuardsCheckStart, - NavigationStart, - RoutesRecognized, - Navigation, } from '../../src'; -import {of} from 'rxjs'; -import {switchMap, mapTo} from 'rxjs/operators'; -import { - TeamCmp, - RootCmp, - BlankCmp, - SimpleCmp, - AbsoluteSimpleLinkCmp, - createRoot, - advance, -} from './integration_helpers'; -import {expect} from '@angular/private/testing/matchers'; import {timeout} from '../helpers'; +import { + AbsoluteSimpleLinkCmp, + BlankCmp, + RootCmp, + SimpleCmp, + TeamCmp, + advance, + createRoot, +} from './integration_helpers'; export function eagerUrlUpdateStrategyIntegrationSuite() { describe('"eager" urlUpdateStrategy', () => { @@ -92,7 +92,7 @@ export function eagerUrlUpdateStrategyIntegrationSuite() { expect(fixture.nativeElement).toHaveText('team 33 [ , right: ]'); }); - it('should eagerly update the URL', async () => { + it('should eagerly update the URL (location.path)', async () => { const router = TestBed.inject(Router); const location = TestBed.inject(Location); const fixture = await createRoot(router, RootCmp); diff --git a/packages/router/test/integration/navigation.spec.ts b/packages/router/test/integration/navigation.spec.ts index 05ca9debc80..fe7360361c8 100644 --- a/packages/router/test/integration/navigation.spec.ts +++ b/packages/router/test/integration/navigation.spec.ts @@ -6,43 +6,42 @@ * found in the LICENSE file at https://angular.dev/license */ -import {ApplicationRef, Component, inject, NgModule} from '@angular/core'; import {Location, PlatformNavigation} from '@angular/common'; +import {ApplicationRef, Component, inject, NgModule} from '@angular/core'; import {TestBed} from '@angular/core/testing'; +import {RouterTestingHarness} from '@angular/router/testing'; +import {BehaviorSubject, filter, firstValueFrom} from 'rxjs'; import { - Event, - provideRouter, - Navigation, - withRouterConfig, - Router, - NavigationStart, - NavigationEnd, - RouterLink, ActivatedRoute, - Params, - RouterModule, - NavigationCancel, - Routes, - NavigationError, - RedirectCommand, - NavigationCancellationCode, ActivationStart, + Event, GuardsCheckStart, - GuardsCheckEnd, + Navigation, + NavigationCancel, + NavigationCancellationCode, + NavigationEnd, + NavigationError, + NavigationStart, + Params, + provideRouter, + RedirectCommand, ResolveStart, + Router, + RouterLink, + RouterModule, + Routes, + withRouterConfig, } from '../../src'; +import {timeout} from '../helpers'; import { + advance, + createRoot, + expectEvents, + onlyNavigationStartAndEnd, + RelativeLinkCmp, RootCmp, SimpleCmp, - onlyNavigationStartAndEnd, - expectEvents, - RelativeLinkCmp, - createRoot, - advance, } from './integration_helpers'; -import {BehaviorSubject, filter, firstValueFrom} from 'rxjs'; -import {RouterTestingHarness} from '@angular/router/testing'; -import {timeout} from '../helpers'; export function navigationIntegrationTestSuite(browserAPI: 'history' | 'navigation') { function setup(routes?: Routes): Router { @@ -88,7 +87,7 @@ export function navigationIntegrationTestSuite(browserAPI: 'history' | 'navigati ]); }); - it('should override default onSameUrlNavigation with extras', async () => { + it('should override default onSameUrlNavigation with extras (ignore => reload)', async () => { TestBed.configureTestingModule({ providers: [provideRouter([], withRouterConfig({onSameUrlNavigation: 'ignore'}))], }); @@ -118,7 +117,7 @@ export function navigationIntegrationTestSuite(browserAPI: 'history' | 'navigati ]); }); - it('should override default onSameUrlNavigation with extras', async () => { + it('should override default onSameUrlNavigation with extras (reload => ignore)', async () => { TestBed.configureTestingModule({ providers: [provideRouter([], withRouterConfig({onSameUrlNavigation: 'reload'}))], }); diff --git a/packages/router/test/integration/navigation_errors.spec.ts b/packages/router/test/integration/navigation_errors.spec.ts index b700f71cad2..f086df83a61 100644 --- a/packages/router/test/integration/navigation_errors.spec.ts +++ b/packages/router/test/integration/navigation_errors.spec.ts @@ -5,48 +5,48 @@ * Use of this source code is governed by an MIT-style license that can be * found in the LICENSE file at https://angular.dev/license */ -import {inject, Injectable} from '@angular/core'; -import {expect} from '@angular/private/testing/matchers'; import {Location} from '@angular/common'; +import {inject, Injectable} from '@angular/core'; import {TestBed} from '@angular/core/testing'; +import {expect} from '@angular/private/testing/matchers'; import { - Router, - NavigationStart, - NavigationError, - RoutesRecognized, - GuardsCheckStart, - Event, - ChildActivationStart, - ActivationStart, - GuardsCheckEnd, - ResolveStart, - ResolveEnd, ActivationEnd, + ActivationStart, ChildActivationEnd, - NavigationEnd, - provideRouter, - withRouterConfig, - withNavigationErrorHandler, - RouterModule, - RedirectCommand, + ChildActivationStart, + Event, + GuardsCheckEnd, + GuardsCheckStart, NavigationCancel, NavigationCancellationCode, + NavigationEnd, + NavigationError, + NavigationStart, + provideRouter, + RedirectCommand, + ResolveEnd, + ResolveStart, + Router, + RouterModule, + RoutesRecognized, + withNavigationErrorHandler, + withRouterConfig, } from '../../src'; import {RouterTestingHarness} from '../../testing'; -import { - RootCmp, - BlankCmp, - UserCmp, - expectEvents, - SimpleCmp, - ThrowingCmp, - ConditionalThrowingCmp, - EmptyQueryParamsCmp, - createRoot, - advance, - simulateLocationChange, -} from './integration_helpers'; import {timeout} from '../helpers'; +import { + advance, + BlankCmp, + ConditionalThrowingCmp, + createRoot, + EmptyQueryParamsCmp, + expectEvents, + RootCmp, + SimpleCmp, + simulateLocationChange, + ThrowingCmp, + UserCmp, +} from './integration_helpers'; export function navigationErrorsIntegrationSuite(browserAPI: 'history' | 'navigation') { it('should handle failed navigations gracefully', async () => { @@ -221,7 +221,7 @@ export function navigationErrorsIntegrationSuite(browserAPI: 'history' | 'naviga // Errors should behave the same for both deferred and eager URL update strategies (['deferred', 'eager'] as const).forEach((urlUpdateStrategy) => { - it('should dispatch NavigationError after the url has been reset back', async () => { + it(`should dispatch NavigationError after the url has been reset back (${urlUpdateStrategy})`, async () => { TestBed.configureTestingModule({ providers: [provideRouter([], withRouterConfig({urlUpdateStrategy}))], }); @@ -252,7 +252,7 @@ export function navigationErrorsIntegrationSuite(browserAPI: 'history' | 'naviga expect(locationUrlBeforeEmittingError).toEqual('/simple'); }); - it('can renavigate to throwing component', async () => { + it(`can renavigate to throwing component (${urlUpdateStrategy})`, async () => { TestBed.configureTestingModule({ providers: [provideRouter([], withRouterConfig({urlUpdateStrategy: 'eager'}))], }); @@ -278,7 +278,7 @@ export function navigationErrorsIntegrationSuite(browserAPI: 'history' | 'naviga expect(fixture.nativeElement.innerHTML).toContain('throwing'); }); - it('should reset the url with the right state when navigation errors', async () => { + it(`should reset the url with the right state when navigation errors (${urlUpdateStrategy})`, async () => { TestBed.configureTestingModule({ providers: [provideRouter([], withRouterConfig({urlUpdateStrategy}))], }); @@ -315,7 +315,7 @@ export function navigationErrorsIntegrationSuite(browserAPI: 'history' | 'naviga expect(event!.restoredState!.navigationId).toEqual(simple1NavStart.id); }); - it('should not trigger another navigation when resetting the url back due to a NavigationError', async () => { + it(`should not trigger another navigation when resetting the url back due to a NavigationError (${urlUpdateStrategy})`, async () => { TestBed.configureTestingModule({ providers: [provideRouter([], withRouterConfig({urlUpdateStrategy}))], }); diff --git a/packages/router/test/url_tree.spec.ts b/packages/router/test/url_tree.spec.ts index e31edb0682d..ba636432777 100644 --- a/packages/router/test/url_tree.spec.ts +++ b/packages/router/test/url_tree.spec.ts @@ -105,7 +105,7 @@ describe('UrlTree', () => { expect(containsTree(t1, t2, exactMatchOptions)).toBe(false); }); - it('should return false when queryParams are not the same', () => { + it('should return false when queryParams are not the same (multiple params)', () => { const t1 = serializer.parse('/one/two?test=4&test=4&test=2'); const t2 = serializer.parse('/one/two?test=4&test=3&test=2'); expect(containsTree(t1, t2, subsetMatchOptions)).toBe(false); @@ -117,7 +117,7 @@ describe('UrlTree', () => { expect(containsTree(t1, t2, subsetMatchOptions)).toBe(true); }); - it('should return true when queryParams are the same in different order', () => { + it('should return true when queryParams are the same in different order (with duplicates)', () => { const t1 = serializer.parse('/one/two?test=4&test=4&test=1'); const t2 = serializer.parse('/one/two?test=1&test=4&test=4'); expect(containsTree(t1, t2, subsetMatchOptions)).toBe(true); diff --git a/packages/zone.js/package.json b/packages/zone.js/package.json index abcfebd9c3b..a8895c4e33c 100644 --- a/packages/zone.js/package.json +++ b/packages/zone.js/package.json @@ -11,7 +11,7 @@ "@csstools/css-calc": "3.0.0", "@csstools/css-color-parser": "4.0.1", "@externs/nodejs": "1.5.0", - "@types/jasmine": "5.1.15", + "@types/jasmine": "6.0.0", "@types/node": "^24.3.0", "@types/systemjs": "6.15.4", "bluebird": "3.7.2", @@ -22,9 +22,9 @@ "jest": "30.2.0", "mocha": "11.7.5", "mock-require": "3.0.3", - "jasmine": "5.13.0", + "jasmine": "6.0.0", "source-map-support": "0.5.21", - "jasmine-core": "5.13.0", + "jasmine-core": "6.0.0", "jasmine-reporters": "2.5.2", "rxjs": "7.8.2", "systemjs": "6.15.1", diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 44fcf91c383..af55307aa8b 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -143,8 +143,8 @@ importers: specifier: 2.0.46 version: 2.0.46 '@types/jasmine': - specifier: ^5.0.0 - version: 5.1.15 + specifier: ^6.0.0 + version: 6.0.0 '@types/jasminewd2': specifier: ^2.0.8 version: 2.0.13 @@ -221,11 +221,11 @@ importers: specifier: ^14.0.0 version: 14.1.1 jasmine: - specifier: 5.13.0 - version: 5.13.0 + specifier: 6.0.0 + version: 6.0.0 jasmine-core: - specifier: 5.13.0 - version: 5.13.0 + specifier: 6.0.0 + version: 6.0.0 jasmine-reporters: specifier: ^2.5.2 version: 2.5.2 @@ -414,8 +414,8 @@ importers: specifier: ^2.2.1 version: 2.2.1 karma-jasmine-html-reporter: - specifier: ^2.1.0 - version: 2.2.0(jasmine-core@5.13.0)(karma-jasmine@5.1.0(karma@6.4.4(bufferutil@4.1.0)(utf-8-validate@6.0.6)))(karma@6.4.4(bufferutil@4.1.0)(utf-8-validate@6.0.6)) + specifier: ^2.2.0 + version: 2.2.0(jasmine-core@6.0.0)(karma-jasmine@5.1.0(karma@6.4.4(bufferutil@4.1.0)(utf-8-validate@6.0.6)))(karma@6.4.4(bufferutil@4.1.0)(utf-8-validate@6.0.6)) karma-sauce-launcher: specifier: ^4.3.6 version: 4.3.6(bufferutil@4.1.0)(encoding@0.1.13)(typescript@5.9.3)(utf-8-validate@6.0.6) @@ -585,8 +585,8 @@ importers: specifier: 1.0.6 version: 1.0.6 '@types/jasmine': - specifier: 5.1.15 - version: 5.1.15 + specifier: 6.0.0 + version: 6.0.0 '@types/jsdom': specifier: 27.0.0 version: 27.0.0 @@ -624,8 +624,8 @@ importers: specifier: 0.8.2 version: 0.8.2 jasmine-core: - specifier: 5.13.0 - version: 5.13.0 + specifier: 6.0.0 + version: 6.0.0 jsdom: specifier: 28.0.0 version: 28.0.0 @@ -640,7 +640,7 @@ importers: version: 5.1.0(karma@6.4.4(bufferutil@4.1.0)(utf-8-validate@6.0.6)) karma-jasmine-html-reporter: specifier: 2.2.0 - version: 2.2.0(jasmine-core@5.13.0)(karma-jasmine@5.1.0(karma@6.4.4(bufferutil@4.1.0)(utf-8-validate@6.0.6)))(karma@6.4.4(bufferutil@4.1.0)(utf-8-validate@6.0.6)) + version: 2.2.0(jasmine-core@6.0.0)(karma-jasmine@5.1.0(karma@6.4.4(bufferutil@4.1.0)(utf-8-validate@6.0.6)))(karma@6.4.4(bufferutil@4.1.0)(utf-8-validate@6.0.6)) marked: specifier: 17.0.1 version: 17.0.1 @@ -896,8 +896,8 @@ importers: specifier: workspace:* version: link:../packages/upgrade '@types/jasmine': - specifier: 5.1.15 - version: 5.1.15 + specifier: 6.0.0 + version: 6.0.0 '@types/jasminewd2': specifier: 2.0.13 version: 2.0.13 @@ -1235,8 +1235,8 @@ importers: specifier: 1.5.0 version: 1.5.0 '@types/jasmine': - specifier: 5.1.15 - version: 5.1.15 + specifier: 6.0.0 + version: 6.0.0 '@types/node': specifier: ^24.3.0 version: 24.10.9 @@ -1253,11 +1253,11 @@ importers: specifier: 3.0.0 version: 3.0.0 jasmine: - specifier: 5.13.0 - version: 5.13.0 + specifier: 6.0.0 + version: 6.0.0 jasmine-core: - specifier: 5.13.0 - version: 5.13.0 + specifier: 6.0.0 + version: 6.0.0 jasmine-reporters: specifier: 2.5.2 version: 2.5.2 @@ -1321,8 +1321,8 @@ importers: version: 5.9.3 devDependencies: '@types/jasmine': - specifier: ~5.1.9 - version: 5.1.15 + specifier: ~6.0.0 + version: 6.0.0 '@types/jasmine-reporters': specifier: ~2.5.3 version: 2.5.3 @@ -1339,11 +1339,11 @@ importers: specifier: ~3.7.0 version: 3.7.1 jasmine: - specifier: ~5.13.0 - version: 5.13.0 + specifier: 6.0.0 + version: 6.0.0 jasmine-core: - specifier: ~5.13.0 - version: 5.13.0 + specifier: 6.0.0 + version: 6.0.0 jasmine-reporters: specifier: ~2.5.2 version: 2.5.2 @@ -5161,9 +5161,6 @@ packages: '@types/jasmine-reporters@2.5.3': resolution: {integrity: sha512-8aojAUdgdiD9VQbllBJb/9gny3lOjz9T5gyMcbYlKe6npwGVsarbr8v2JYSFJSZSuFYXcPVzFG2lLX3ib0j/DA==} - '@types/jasmine@5.1.15': - resolution: {integrity: sha512-ZAC8KjmV2MJxbNTrwXFN+HKeajpXQZp6KpPiR6Aa4XvaEnjP6qh23lL/Rqb7AYzlp3h/rcwDrQ7Gg7q28cQTQg==} - '@types/jasmine@6.0.0': resolution: {integrity: sha512-18lgGsLmEh3VJk9eZ5wAjTISxdqzl6YOwu8UdMpolajN57QOCNbl+AbHUd+Yu9ItrsFdB+c8LSZSGNg8nHaguw==} @@ -8932,6 +8929,9 @@ packages: jasmine-core@5.13.0: resolution: {integrity: sha512-vsYjfh7lyqvZX5QgqKc4YH8phs7g96Z8bsdIFNEU3VqXhlHaq+vov/Fgn/sr6MiUczdZkyXRC3TX369Ll4Nzbw==} + jasmine-core@6.0.0: + resolution: {integrity: sha512-fmBb8aruz2mEIDBUGWOGNmxhXwFJs44SSzwbMcBDqQnNChavPTq3Ra9A6WAn6WdxvxWEdakKTcEb3NzeR3yD1A==} + jasmine-core@6.0.1: resolution: {integrity: sha512-gUtzV5ASR0MLBwDNqri4kBsgKNCcRQd9qOlNw/w/deavD0cl3JmWXXfH8JhKM4LTg6LPTt2IOQ4px3YYfgh2Xg==} @@ -8942,10 +8942,6 @@ packages: resolution: {integrity: sha512-KbdGQTf5jbZgltoHs31XGiChAPumMSY64OZMWLNYnEnMfG5uwGBhffePwuskexjT+/Jea/gU3qAU8344hNohSw==} hasBin: true - jasmine@5.13.0: - resolution: {integrity: sha512-oLCXIhEb5e0zzjn9GyuvcuisvLBwUjmgz7a0RNGWKwQtJCDld4m+vwKUpAIJVLB5vbmQFdtKhT86/tIZlJ5gYw==} - hasBin: true - jasmine@6.0.0: resolution: {integrity: sha512-eSPL6LPWT39WwvHSEEbRXuSvioXMTheNhIPaeUT1OPmSprDZwj4S29884DkTx6/tyiOWTWB1N+LdW2ZSg74aEA==} hasBin: true @@ -10823,7 +10819,6 @@ packages: engines: {node: '>=0.6.0', teleport: '>=0.2.0'} deprecated: |- You or someone you depend on is using Q, the JavaScript Promise library that gave JavaScript developers strong feelings about promises. They can almost certainly migrate to the native JavaScript promise now. Thank you literally everyone for joining me in this bet against the odds. Be excellent to each other. - (For a CapTP with native promises, see @endo/eventual-send and @endo/captp) qjobs@1.2.0: @@ -11817,6 +11812,7 @@ packages: tar@7.5.7: resolution: {integrity: sha512-fov56fJiRuThVFXD6o6/Q354S7pnWMJIVlDBYijsTNx6jKSE4pvrDTs6lUnmGvNyfJwFQQwWy3owKz1ucIhveQ==} engines: {node: '>=18'} + deprecated: Old versions of tar are not supported, and contain widely publicized security vulnerabilities, which have been fixed in the current version. Please update. Support for old versions may be purchased (at exorbitant rates) by contacting i@izs.me tcp-port-used@1.0.2: resolution: {integrity: sha512-l7ar8lLUD3XS1V2lfoJlCBaeoaWo/2xfYt81hM7VlvR4RrMVFqfmzfhLVk40hAb368uitje5gPtBRL1m/DGvLA==} @@ -18000,15 +17996,13 @@ snapshots: '@types/jasmine-reporters@2.5.3': dependencies: - '@types/jasmine': 5.1.15 - - '@types/jasmine@5.1.15': {} + '@types/jasmine': 6.0.0 '@types/jasmine@6.0.0': {} '@types/jasminewd2@2.0.13': dependencies: - '@types/jasmine': 5.1.15 + '@types/jasmine': 6.0.0 '@types/jsdom@21.1.7': dependencies: @@ -22462,6 +22456,8 @@ snapshots: jasmine-core@5.13.0: {} + jasmine-core@6.0.0: {} + jasmine-core@6.0.1: {} jasmine-reporters@2.5.2: @@ -22475,11 +22471,6 @@ snapshots: glob: 7.2.3 jasmine-core: 2.8.0 - jasmine@5.13.0: - dependencies: - glob: 10.5.0 - jasmine-core: 5.13.0 - jasmine@6.0.0: dependencies: '@jasminejs/reporters': 1.0.0 @@ -23142,9 +23133,9 @@ snapshots: is-wsl: 2.2.0 which: 3.0.1 - karma-jasmine-html-reporter@2.2.0(jasmine-core@5.13.0)(karma-jasmine@5.1.0(karma@6.4.4(bufferutil@4.1.0)(utf-8-validate@6.0.6)))(karma@6.4.4(bufferutil@4.1.0)(utf-8-validate@6.0.6)): + karma-jasmine-html-reporter@2.2.0(jasmine-core@6.0.0)(karma-jasmine@5.1.0(karma@6.4.4(bufferutil@4.1.0)(utf-8-validate@6.0.6)))(karma@6.4.4(bufferutil@4.1.0)(utf-8-validate@6.0.6)): dependencies: - jasmine-core: 5.13.0 + jasmine-core: 6.0.0 karma: 6.4.4(bufferutil@4.1.0)(utf-8-validate@6.0.6) karma-jasmine: 5.1.0(karma@6.4.4(bufferutil@4.1.0)(utf-8-validate@6.0.6)) diff --git a/vscode-ng-language-service/package.json b/vscode-ng-language-service/package.json index 7a2df00eacf..fb2d921cc62 100644 --- a/vscode-ng-language-service/package.json +++ b/vscode-ng-language-service/package.json @@ -275,14 +275,14 @@ "typescript": "5.9.3" }, "devDependencies": { - "@types/jasmine": "~5.1.9", + "@types/jasmine": "~6.0.0", "@types/jasmine-reporters": "~2.5.3", "@types/node": "^24.5.2", "@types/vscode": "^1.74.3", "@vscode/test-electron": "~2.5.2", "@vscode/vsce": "~3.7.0", - "jasmine": "~5.13.0", - "jasmine-core": "~5.13.0", + "jasmine": "6.0.0", + "jasmine-core": "6.0.0", "jasmine-reporters": "~2.5.2", "source-map-support": "^0.5.21", "vscode-jsonrpc": "8.2.0",