build: update Jasmine to 6.0.0

Jasmine enables `forbidDuplicateNames: true` by default. So we also need to desambiguate duplicate spec names.
This commit is contained in:
Angular Robot
2026-02-04 10:23:04 +00:00
committed by Andrew Kushnir
parent 85d6a2bc6e
commit 11767cabe4
117 changed files with 917 additions and 1402 deletions
@@ -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') {
@@ -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',
+4 -4
View File
@@ -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',
@@ -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',
`
@@ -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',
`
@@ -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);
});