Skip to content

Commit 83d35d4

Browse files
committed
build: update jasmine dependencies to v6
See associated pull request for more information. Closes #32423 as a pr takeover
1 parent bfdc7b0 commit 83d35d4

File tree

34 files changed

+1554
-1756
lines changed

34 files changed

+1554
-1756
lines changed

modules/testing/builder/src/jasmine-helpers.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,8 @@ export const BUILD_TIMEOUT = 30_000;
2525

2626
const optionSchemaCache = new Map<string, json.schema.JsonSchema>();
2727

28+
let counter = 0;
29+
2830
export function describeBuilder<T>(
2931
builderHandler: BuilderHandlerFn<T & json.JsonObject>,
3032
options: { name?: string; schemaPath: string },
@@ -40,10 +42,8 @@ export function describeBuilder<T>(
4042
optionSchema,
4143
});
4244

43-
// This is needed as there are multiple describe calls for the same builder.
44-
jasmine.getEnv().configure({ forbidDuplicateNames: false });
45-
46-
describe(options.name || builderHandler.name, () => {
45+
// The counter is needed to avoid duplicate describe names as they are not allowed.
46+
describe((options.name || builderHandler.name) + ` (Suite: ${counter++})`, () => {
4747
beforeEach(async () => {
4848
harness.resetProjectMetadata();
4949

package.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@
7474
"@types/express": "~5.0.1",
7575
"@types/http-proxy": "^1.17.4",
7676
"@types/ini": "^4.0.0",
77-
"@types/jasmine": "~5.1.0",
77+
"@types/jasmine": "~6.0.0",
7878
"@types/jasmine-reporters": "^2",
7979
"@types/karma": "^6.3.0",
8080
"@types/less": "^3.0.3",
@@ -105,8 +105,8 @@
105105
"http-proxy": "^1.18.1",
106106
"http-proxy-middleware": "3.0.5",
107107
"husky": "9.1.7",
108-
"jasmine": "~5.13.0",
109-
"jasmine-core": "~5.13.0",
108+
"jasmine": "~6.1.0",
109+
"jasmine-core": "~6.1.0",
110110
"jasmine-reporters": "^2.5.2",
111111
"jasmine-spec-reporter": "~7.0.0",
112112
"karma": "~6.4.0",

packages/angular/build/src/builders/dev-server/tests/jasmine-helpers.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ import { readFileSync } from 'node:fs';
1212
import { JasmineBuilderHarness, host, setupApplicationTarget } from './setup';
1313

1414
const optionSchemaCache = new Map<string, json.schema.JsonSchema>();
15+
let counter = 0;
1516

1617
export function describeServeBuilder<T>(
1718
builderHandler: BuilderHandlerFn<T & json.JsonObject>,
@@ -32,7 +33,8 @@ export function describeServeBuilder<T>(
3233
optionSchema,
3334
});
3435

35-
describe(options.name || builderHandler.name, () => {
36+
// The counter is needed to avoid duplicate describe names as they are not allowed.
37+
describe((options.name || builderHandler.name) + ` (${counter++})`, () => {
3638
beforeEach(() => host.initialize().toPromise());
3739
afterEach(() => host.restore().toPromise());
3840

packages/angular/build/src/builders/karma/find-tests_spec.ts

Lines changed: 0 additions & 97 deletions
This file was deleted.

packages/angular/build/src/builders/karma/tests/setup.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -112,6 +112,8 @@ export async function setupApplicationTarget<T>(
112112
await harness.appendToFile('src/polyfills.ts', `import '@angular/localize/init';`);
113113
}
114114

115+
let counter = 0;
116+
115117
/** Runs the test against both an application- and a browser-builder context. */
116118
export function describeKarmaBuilder<T>(
117119
builderHandler: BuilderHandlerFn<T & json.JsonObject>,
@@ -128,7 +130,7 @@ export function describeKarmaBuilder<T>(
128130
optionSchema,
129131
});
130132

131-
describe(options.name || builderHandler.name, () => {
133+
describe((options.name || builderHandler.name) + ` (${counter++})`, () => {
132134
beforeEach(async () => {
133135
await host.initialize().toPromise();
134136

packages/angular/build/src/builders/unit-test/tests/options/code-coverage_spec.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ describeBuilder(execute, UNIT_TEST_BUILDER_INFO, (harness) => {
4242
harness.expectFile('coverage/test/index.html').toExist();
4343
});
4444

45-
it('should generate a code coverage report when coverage is true', async () => {
45+
it('should generate a code coverage report when coverage is true and coverageReporters is set to json', async () => {
4646
harness.useTarget('test', {
4747
...BASE_OPTIONS,
4848
coverage: true,

packages/angular/build/src/tools/babel/plugins/elide-angular-metadata_spec.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -188,7 +188,7 @@ describe('elide-angular-metadata Babel plugin', () => {
188188
);
189189

190190
it(
191-
'elides arrow-function-based ɵsetClassMetadataAsync',
191+
'elides ɵsetClassDebugInfo',
192192
testCase({
193193
input: `
194194
import { Component } from '@angular/core';

packages/angular/build/src/tools/babel/plugins/pure-toplevel-functions_spec.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,7 @@ describe('pure-toplevel-functions Babel plugin', () => {
100100
);
101101

102102
it(
103-
'does not annotate call expressions inside function expressions',
103+
'does not annotate call expressions inside arrow functions',
104104
testCaseNoChange('const foo = () => { const result = someFunction(); }'),
105105
);
106106

@@ -115,7 +115,7 @@ describe('pure-toplevel-functions Babel plugin', () => {
115115
);
116116

117117
it(
118-
'does not annotate new expressions inside function expressions',
118+
'does not annotate new expressions inside arrow functions',
119119
testCaseNoChange('const foo = () => { const result = new SomeClass(); }'),
120120
);
121121

packages/angular/ssr/test/app_spec.ts

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -309,17 +309,6 @@ describe('AngularServerApp', () => {
309309
expect(await conditionalResponse?.text()).toBe('');
310310
});
311311

312-
it('should return configured headers for pages with specific header settings', async () => {
313-
const response = await app.handle(new Request('http://localhost/home-ssg'));
314-
const headers = response?.headers.entries() ?? [];
315-
expect(Object.fromEntries(headers)).toEqual({
316-
'etag': '"f799132d0a09e0fef93c68a12e443527700eb59e6f67fcb7854c3a60ff082fde"',
317-
'content-length': '28',
318-
'x-some-header': 'value',
319-
'content-type': 'text/html;charset=UTF-8',
320-
});
321-
});
322-
323312
it('should return null for a non-prerendered page', async () => {
324313
const response = await app.handle(new Request('http://localhost/unknown'));
325314
expect(response).toBeNull();

packages/angular_devkit/architect/src/api_spec.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ describe('Architect API', () => {
4040
for (const ts of Object.getOwnPropertyNames(goldens)) {
4141
const t: Target = goldens[ts];
4242

43-
it(`works for ${JSON.stringify(t)}`, () => {
43+
it(`works for ${JSON.stringify(ts)}`, () => {
4444
// We have some invalid goldens. Remove everything after the second :.
4545
const goldenTs = ts.replace(/(\w+:\w+(:\w*)?).*/, '$1');
4646
expect(targetStringFromTarget(t)).toEqual(goldenTs);

0 commit comments

Comments
 (0)