Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions modules/testing/builder/src/jasmine-helpers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,8 @@ export const BUILD_TIMEOUT = 30_000;

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

let counter = 0;

export function describeBuilder<T>(
builderHandler: BuilderHandlerFn<T & json.JsonObject>,
options: { name?: string; schemaPath: string },
Expand All @@ -40,10 +42,8 @@ export function describeBuilder<T>(
optionSchema,
});

// This is needed as there are multiple describe calls for the same builder.
jasmine.getEnv().configure({ forbidDuplicateNames: false });

describe(options.name || builderHandler.name, () => {
// The counter is needed to avoid duplicate describe names as they are not allowed.
describe((options.name || builderHandler.name) + ` (Suite: ${counter++})`, () => {
beforeEach(async () => {
harness.resetProjectMetadata();

Expand Down
6 changes: 3 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@
"@types/express": "~5.0.1",
"@types/http-proxy": "^1.17.4",
"@types/ini": "^4.0.0",
"@types/jasmine": "~5.1.0",
"@types/jasmine": "~6.0.0",
"@types/jasmine-reporters": "^2",
"@types/karma": "^6.3.0",
"@types/less": "^3.0.3",
Expand Down Expand Up @@ -105,8 +105,8 @@
"http-proxy": "^1.18.1",
"http-proxy-middleware": "3.0.5",
"husky": "9.1.7",
"jasmine": "~5.13.0",
"jasmine-core": "~5.13.0",
"jasmine": "~6.1.0",
"jasmine-core": "~6.1.0",
"jasmine-reporters": "^2.5.2",
"jasmine-spec-reporter": "~7.0.0",
"karma": "~6.4.0",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ import { readFileSync } from 'node:fs';
import { JasmineBuilderHarness, host, setupApplicationTarget } from './setup';

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

export function describeServeBuilder<T>(
builderHandler: BuilderHandlerFn<T & json.JsonObject>,
Expand All @@ -32,7 +33,8 @@ export function describeServeBuilder<T>(
optionSchema,
});

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

Expand Down
97 changes: 0 additions & 97 deletions packages/angular/build/src/builders/karma/find-tests_spec.ts

This file was deleted.

4 changes: 3 additions & 1 deletion packages/angular/build/src/builders/karma/tests/setup.ts
Original file line number Diff line number Diff line change
Expand Up @@ -112,6 +112,8 @@ export async function setupApplicationTarget<T>(
await harness.appendToFile('src/polyfills.ts', `import '@angular/localize/init';`);
}

let counter = 0;

/** Runs the test against both an application- and a browser-builder context. */
export function describeKarmaBuilder<T>(
builderHandler: BuilderHandlerFn<T & json.JsonObject>,
Expand All @@ -128,7 +130,7 @@ export function describeKarmaBuilder<T>(
optionSchema,
});

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

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ describeBuilder(execute, UNIT_TEST_BUILDER_INFO, (harness) => {
harness.expectFile('coverage/test/index.html').toExist();
});

it('should generate a code coverage report when coverage is true', async () => {
it('should generate a code coverage report when coverage is true and coverageReporters is set to json', async () => {
harness.useTarget('test', {
...BASE_OPTIONS,
coverage: true,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -188,7 +188,7 @@ describe('elide-angular-metadata Babel plugin', () => {
);

it(
'elides arrow-function-based ɵsetClassMetadataAsync',
'elides ɵsetClassDebugInfo',
testCase({
input: `
import { Component } from '@angular/core';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ describe('pure-toplevel-functions Babel plugin', () => {
);

it(
'does not annotate call expressions inside function expressions',
'does not annotate call expressions inside arrow functions',
testCaseNoChange('const foo = () => { const result = someFunction(); }'),
);

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

it(
'does not annotate new expressions inside function expressions',
'does not annotate new expressions inside arrow functions',
testCaseNoChange('const foo = () => { const result = new SomeClass(); }'),
);

Expand Down
11 changes: 0 additions & 11 deletions packages/angular/ssr/test/app_spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -309,17 +309,6 @@ describe('AngularServerApp', () => {
expect(await conditionalResponse?.text()).toBe('');
});

it('should return configured headers for pages with specific header settings', async () => {
const response = await app.handle(new Request('http://localhost/home-ssg'));
const headers = response?.headers.entries() ?? [];
expect(Object.fromEntries(headers)).toEqual({
'etag': '"f799132d0a09e0fef93c68a12e443527700eb59e6f67fcb7854c3a60ff082fde"',
'content-length': '28',
'x-some-header': 'value',
'content-type': 'text/html;charset=UTF-8',
});
});

it('should return null for a non-prerendered page', async () => {
const response = await app.handle(new Request('http://localhost/unknown'));
expect(response).toBeNull();
Expand Down
2 changes: 1 addition & 1 deletion packages/angular_devkit/architect/src/api_spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ describe('Architect API', () => {
for (const ts of Object.getOwnPropertyNames(goldens)) {
const t: Target = goldens[ts];

it(`works for ${JSON.stringify(t)}`, () => {
it(`works for ${JSON.stringify(ts)}`, () => {
// We have some invalid goldens. Remove everything after the second :.
const goldenTs = ts.replace(/(\w+:\w+(:\w*)?).*/, '$1');
expect(targetStringFromTarget(t)).toEqual(goldenTs);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ describe('Browser Builder tsconfig paths', () => {
});
afterEach(async () => host.restore().toPromise());

it('works', async () => {
it('should resolve basic tsconfig paths', async () => {
host.replaceInFile('src/app/app.module.ts', './app.component', '@root/app/app.component');
host.replaceInFile(
'tsconfig.json',
Expand All @@ -37,7 +37,7 @@ describe('Browser Builder tsconfig paths', () => {
await browserBuild(architect, host, target);
});

it('works', async () => {
it('should resolve complex tsconfig paths with wildcards', async () => {
host.writeMultipleFiles({
'src/meaning-too.ts': 'export var meaning = 42;',
'src/app/shared/meaning.ts': 'export var meaning = 42;',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ import { host } from '../../../testing/test-utils';
import { setupApplicationTarget, setupBrowserTarget } from './setup';

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

export function describeServeBuilder<T extends json.JsonObject>(
builderHandler: BuilderHandlerFn<T>,
Expand All @@ -39,7 +40,8 @@ export function describeServeBuilder<T extends json.JsonObject>(
optionSchema,
});

describe(options.name || builderHandler.name, () => {
// The counter is needed to avoid duplicate describe names as they are not allowed.
describe((options.name || builderHandler.name) + ` (${counter++})`, () => {
for (const isViteRun of [true, false]) {
describe(isViteRun ? 'vite' : 'webpack-dev-server', () => {
beforeEach(() => host.initialize().toPromise());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -140,6 +140,8 @@ export async function setupApplicationTarget<T>(
await harness.appendToFile('src/polyfills.ts', `import '@angular/localize/init';`);
}

let counter = 0;

/** Runs the test against both an application- and a browser-builder context. */
export function describeKarmaBuilder<T>(
builderHandler: BuilderHandlerFn<T & json.JsonObject>,
Expand All @@ -161,7 +163,8 @@ export function describeKarmaBuilder<T>(
optionSchema,
});

describe(options.name || builderHandler.name, () => {
// The counter is needed to avoid duplicate describe names as they are not allowed.
describe((options.name || builderHandler.name) + ` (${counter++})`, () => {
for (const isApplicationTarget of [true, false]) {
describe(isApplicationTarget ? 'with application builder' : 'with browser builder', () => {
beforeEach(() => host.initialize().toPromise());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ import * as http from 'node:http';
import { createArchitect, host } from '../../../testing/test-utils';
import { SSRDevServerBuilderOutput } from '../index';

describe('Serve SSR Builder', () => {
describe('Serve SSR Builder - Proxy', () => {
const target = { project: 'app', target: 'serve-ssr' };
const originalTimeout = jasmine.DEFAULT_TIMEOUT_INTERVAL;
let architect: Architect;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ import { Agent } from 'undici';
import { createArchitect, host } from '../../../testing/test-utils';
import { SSRDevServerBuilderOutput } from '../index';

describe('Serve SSR Builder', () => {
describe('Serve SSR Builder - SSL', () => {
const target = { project: 'app', target: 'serve-ssr' };
const originalTimeout = jasmine.DEFAULT_TIMEOUT_INTERVAL;
let architect: Architect;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ import * as browserSync from 'browser-sync';
import { createArchitect, host } from '../../../testing/test-utils';
import { SSRDevServerBuilderOutput } from '../index';

describe('Serve SSR Builder', () => {
describe('Serve SSR Builder - Works', () => {
const target = { project: 'app', target: 'serve-ssr' };
const originalTimeout = jasmine.DEFAULT_TIMEOUT_INTERVAL;
let architect: Architect;
Expand Down
4 changes: 2 additions & 2 deletions packages/angular_devkit/core/src/virtual-fs/path_spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -94,9 +94,9 @@ describe('path', () => {
];

for (const [input, result] of tests) {
const normalizedInput = normalize(input);
it(`(${input}) == "${result}"`, () => {
const normalizedInput = normalize(input);

it(`(${JSON.stringify(normalizedInput)}) == "${result}"`, () => {
expect(split(normalizedInput)).toEqual(result as PathFragment[]);
});
}
Expand Down
Loading