@angular-devkit/build-angular 21.2.1 → 22.0.0-next.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (72) hide show
  1. package/README.md +0 -1
  2. package/builders.json +0 -20
  3. package/package.json +20 -37
  4. package/src/builders/app-shell/index.js +2 -2
  5. package/src/builders/app-shell/index.js.map +1 -1
  6. package/src/builders/karma/index.js +1 -1
  7. package/src/builders/karma/index.js.map +1 -1
  8. package/src/builders/server/index.js +1 -0
  9. package/src/builders/server/index.js.map +1 -1
  10. package/src/builders/ssr-dev-server/utils.js +2 -6
  11. package/src/builders/ssr-dev-server/utils.js.map +1 -1
  12. package/src/index.d.ts +0 -1
  13. package/src/index.js +1 -3
  14. package/src/index.js.map +1 -1
  15. package/src/tools/webpack/utils/stats.js +1 -2
  16. package/src/tools/webpack/utils/stats.js.map +1 -1
  17. package/src/utils/index.d.ts +0 -1
  18. package/src/utils/index.js +0 -1
  19. package/src/utils/index.js.map +1 -1
  20. package/src/utils/normalize-asset-patterns.js +1 -1
  21. package/src/utils/normalize-asset-patterns.js.map +1 -1
  22. package/src/utils/normalize-cache.js +1 -1
  23. package/src/utils/process-bundle.js +5 -5
  24. package/src/utils/process-bundle.js.map +1 -1
  25. package/src/builders/jest/index.d.ts +0 -11
  26. package/src/builders/jest/index.js +0 -213
  27. package/src/builders/jest/index.js.map +0 -1
  28. package/src/builders/jest/init-test-bed.mjs +0 -24
  29. package/src/builders/jest/jest-global.mjs +0 -19
  30. package/src/builders/jest/jest.config.mjs +0 -11
  31. package/src/builders/jest/options.d.ts +0 -21
  32. package/src/builders/jest/options.js +0 -25
  33. package/src/builders/jest/options.js.map +0 -1
  34. package/src/builders/jest/schema.d.ts +0 -26
  35. package/src/builders/jest/schema.js +0 -5
  36. package/src/builders/jest/schema.js.map +0 -1
  37. package/src/builders/jest/schema.json +0 -44
  38. package/src/builders/protractor/index.d.ts +0 -16
  39. package/src/builders/protractor/index.js +0 -177
  40. package/src/builders/protractor/index.js.map +0 -1
  41. package/src/builders/protractor/schema.d.ts +0 -47
  42. package/src/builders/protractor/schema.js +0 -5
  43. package/src/builders/protractor/schema.js.map +0 -1
  44. package/src/builders/protractor/schema.json +0 -58
  45. package/src/builders/protractor-error/index.d.ts +0 -10
  46. package/src/builders/protractor-error/index.js +0 -15
  47. package/src/builders/protractor-error/index.js.map +0 -1
  48. package/src/builders/web-test-runner/builder-status-warnings.d.ts +0 -11
  49. package/src/builders/web-test-runner/builder-status-warnings.js +0 -46
  50. package/src/builders/web-test-runner/builder-status-warnings.js.map +0 -1
  51. package/src/builders/web-test-runner/index.d.ts +0 -10
  52. package/src/builders/web-test-runner/index.js +0 -162
  53. package/src/builders/web-test-runner/index.js.map +0 -1
  54. package/src/builders/web-test-runner/jasmine_runner.js +0 -91
  55. package/src/builders/web-test-runner/options.d.ts +0 -24
  56. package/src/builders/web-test-runner/options.js +0 -26
  57. package/src/builders/web-test-runner/options.js.map +0 -1
  58. package/src/builders/web-test-runner/schema.d.ts +0 -192
  59. package/src/builders/web-test-runner/schema.js +0 -16
  60. package/src/builders/web-test-runner/schema.js.map +0 -1
  61. package/src/builders/web-test-runner/schema.json +0 -297
  62. package/src/builders/web-test-runner/test_page.html +0 -40
  63. package/src/builders/web-test-runner/write-test-files.d.ts +0 -9
  64. package/src/builders/web-test-runner/write-test-files.js +0 -42
  65. package/src/builders/web-test-runner/write-test-files.js.map +0 -1
  66. package/src/utils/run-module-as-observable-fork.d.ts +0 -10
  67. package/src/utils/run-module-as-observable-fork.js +0 -78
  68. package/src/utils/run-module-as-observable-fork.js.map +0 -1
  69. package/src/utils/run-module-worker.js +0 -18
  70. package/src/utils/test-files.d.ts +0 -18
  71. package/src/utils/test-files.js +0 -32
  72. package/src/utils/test-files.js.map +0 -1
@@ -1,47 +0,0 @@
1
- /**
2
- * Protractor target options for Build Facade.
3
- */
4
- export type Schema = {
5
- /**
6
- * Base URL for protractor to connect to.
7
- */
8
- baseUrl?: string;
9
- /**
10
- * A dev-server builder target to run tests against in the format of
11
- * `project:target[:configuration]`. You can also pass in more than one configuration name
12
- * as a comma-separated list. Example: `project:target:production,staging`.
13
- */
14
- devServerTarget?: string;
15
- /**
16
- * Execute specs whose names match the pattern, which is internally compiled to a RegExp.
17
- */
18
- grep?: string;
19
- /**
20
- * Host to listen on.
21
- */
22
- host?: string;
23
- /**
24
- * Invert the selection specified by the 'grep' option.
25
- */
26
- invertGrep?: boolean;
27
- /**
28
- * The port to use to serve the application.
29
- */
30
- port?: number;
31
- /**
32
- * The name of the Protractor configuration file.
33
- */
34
- protractorConfig: string;
35
- /**
36
- * Override specs in the protractor config.
37
- */
38
- specs?: string[];
39
- /**
40
- * Override suite in the protractor config.
41
- */
42
- suite?: string;
43
- /**
44
- * Try to update webdriver.
45
- */
46
- webdriverUpdate?: boolean;
47
- };
@@ -1,5 +0,0 @@
1
- "use strict";
2
- // THIS FILE IS AUTOMATICALLY GENERATED. TO UPDATE THIS FILE YOU NEED TO CHANGE THE
3
- // CORRESPONDING JSON SCHEMA FILE, THEN RUN devkit-admin build (or bazel build ...).
4
- Object.defineProperty(exports, "__esModule", { value: true });
5
- //# sourceMappingURL=schema.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"schema.js","sourceRoot":"","sources":["schema.ts"],"names":[],"mappings":";AACA,mFAAmF;AACnF,oFAAoF"}
@@ -1,58 +0,0 @@
1
- {
2
- "$schema": "http://json-schema.org/draft-07/schema",
3
- "title": "Protractor Target",
4
- "description": "Protractor target options for Build Facade.",
5
- "type": "object",
6
- "properties": {
7
- "protractorConfig": {
8
- "type": "string",
9
- "description": "The name of the Protractor configuration file."
10
- },
11
- "devServerTarget": {
12
- "type": "string",
13
- "description": "A dev-server builder target to run tests against in the format of `project:target[:configuration]`. You can also pass in more than one configuration name as a comma-separated list. Example: `project:target:production,staging`.",
14
- "pattern": "^([^:\\s]+:[^:\\s]+(:[^\\s]+)?)?$"
15
- },
16
- "grep": {
17
- "type": "string",
18
- "description": "Execute specs whose names match the pattern, which is internally compiled to a RegExp."
19
- },
20
- "invertGrep": {
21
- "type": "boolean",
22
- "description": "Invert the selection specified by the 'grep' option.",
23
- "default": false
24
- },
25
- "specs": {
26
- "type": "array",
27
- "description": "Override specs in the protractor config.",
28
- "default": [],
29
- "items": {
30
- "type": "string",
31
- "description": "Spec name."
32
- }
33
- },
34
- "suite": {
35
- "type": "string",
36
- "description": "Override suite in the protractor config."
37
- },
38
- "webdriverUpdate": {
39
- "type": "boolean",
40
- "description": "Try to update webdriver.",
41
- "default": true
42
- },
43
- "port": {
44
- "type": "number",
45
- "description": "The port to use to serve the application."
46
- },
47
- "host": {
48
- "type": "string",
49
- "description": "Host to listen on."
50
- },
51
- "baseUrl": {
52
- "type": "string",
53
- "description": "Base URL for protractor to connect to."
54
- }
55
- },
56
- "additionalProperties": false,
57
- "required": ["protractorConfig"]
58
- }
@@ -1,10 +0,0 @@
1
- /**
2
- * @license
3
- * Copyright Google LLC All Rights Reserved.
4
- *
5
- * Use of this source code is governed by an MIT-style license that can be
6
- * found in the LICENSE file at https://angular.dev/license
7
- */
8
- import { Schema as ProtractorBuilderOptions } from '../protractor/schema';
9
- declare const _default: import("@angular-devkit/architect").Builder<ProtractorBuilderOptions & import("@angular-devkit/core").JsonObject>;
10
- export default _default;
@@ -1,15 +0,0 @@
1
- "use strict";
2
- /**
3
- * @license
4
- * Copyright Google LLC All Rights Reserved.
5
- *
6
- * Use of this source code is governed by an MIT-style license that can be
7
- * found in the LICENSE file at https://angular.dev/license
8
- */
9
- Object.defineProperty(exports, "__esModule", { value: true });
10
- const architect_1 = require("@angular-devkit/architect");
11
- exports.default = (0, architect_1.createBuilder)((_options, context) => {
12
- context.logger.error('Protractor has reached end-of-life and is no longer supported. For additional information and alternatives, please see https://blog.angular.dev/protractor-deprecation-update-august-2023-2beac7402ce0.');
13
- return { success: false };
14
- });
15
- //# sourceMappingURL=index.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["index.ts"],"names":[],"mappings":";AAAA;;;;;;GAMG;;AAEH,yDAA0E;AAG1E,kBAAe,IAAA,yBAAa,EAC1B,CAAC,QAAkC,EAAE,OAAuB,EAAE,EAAE;IAC9D,OAAO,CAAC,MAAM,CAAC,KAAK,CAClB,yMAAyM,CAC1M,CAAC;IAEF,OAAO,EAAE,OAAO,EAAE,KAAK,EAAE,CAAC;AAC5B,CAAC,CACF,CAAC"}
@@ -1,11 +0,0 @@
1
- /**
2
- * @license
3
- * Copyright Google LLC All Rights Reserved.
4
- *
5
- * Use of this source code is governed by an MIT-style license that can be
6
- * found in the LICENSE file at https://angular.dev/license
7
- */
8
- import { BuilderContext } from '@angular-devkit/architect';
9
- import { Schema as WtrBuilderOptions } from './schema';
10
- /** Logs a warning for any unsupported options specified. */
11
- export declare function logBuilderStatusWarnings(options: WtrBuilderOptions, ctx: BuilderContext): void;
@@ -1,46 +0,0 @@
1
- "use strict";
2
- /**
3
- * @license
4
- * Copyright Google LLC All Rights Reserved.
5
- *
6
- * Use of this source code is governed by an MIT-style license that can be
7
- * found in the LICENSE file at https://angular.dev/license
8
- */
9
- Object.defineProperty(exports, "__esModule", { value: true });
10
- exports.logBuilderStatusWarnings = logBuilderStatusWarnings;
11
- const UNSUPPORTED_OPTIONS = [
12
- 'main',
13
- 'assets',
14
- 'scripts',
15
- 'styles',
16
- 'inlineStyleLanguage',
17
- 'stylePreprocessorOptions',
18
- 'sourceMap',
19
- 'progress',
20
- 'poll',
21
- 'preserveSymlinks',
22
- 'browsers',
23
- 'codeCoverage',
24
- 'codeCoverageExclude',
25
- 'fileReplacements',
26
- 'webWorkerTsConfig',
27
- 'watch',
28
- ];
29
- /** Logs a warning for any unsupported options specified. */
30
- function logBuilderStatusWarnings(options, ctx) {
31
- // Validate supported options
32
- for (const unsupportedOption of UNSUPPORTED_OPTIONS) {
33
- const value = options[unsupportedOption];
34
- if (value === undefined || value === false) {
35
- continue;
36
- }
37
- if (Array.isArray(value) && value.length === 0) {
38
- continue;
39
- }
40
- if (typeof value === 'object' && Object.keys(value).length === 0) {
41
- continue;
42
- }
43
- ctx.logger.warn(`The '${unsupportedOption}' option is not yet supported by this builder.`);
44
- }
45
- }
46
- //# sourceMappingURL=builder-status-warnings.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"builder-status-warnings.js","sourceRoot":"","sources":["builder-status-warnings.ts"],"names":[],"mappings":";AAAA;;;;;;GAMG;;AAyBH,4DAiBC;AArCD,MAAM,mBAAmB,GAAmC;IAC1D,MAAM;IACN,QAAQ;IACR,SAAS;IACT,QAAQ;IACR,qBAAqB;IACrB,0BAA0B;IAC1B,WAAW;IACX,UAAU;IACV,MAAM;IACN,kBAAkB;IAClB,UAAU;IACV,cAAc;IACd,qBAAqB;IACrB,kBAAkB;IAClB,mBAAmB;IACnB,OAAO;CACR,CAAC;AAEF,4DAA4D;AAC5D,SAAgB,wBAAwB,CAAC,OAA0B,EAAE,GAAmB;IACtF,6BAA6B;IAC7B,KAAK,MAAM,iBAAiB,IAAI,mBAAmB,EAAE,CAAC;QACpD,MAAM,KAAK,GAAI,OAAwC,CAAC,iBAAiB,CAAC,CAAC;QAE3E,IAAI,KAAK,KAAK,SAAS,IAAI,KAAK,KAAK,KAAK,EAAE,CAAC;YAC3C,SAAS;QACX,CAAC;QACD,IAAI,KAAK,CAAC,OAAO,CAAC,KAAK,CAAC,IAAI,KAAK,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;YAC/C,SAAS;QACX,CAAC;QACD,IAAI,OAAO,KAAK,KAAK,QAAQ,IAAI,MAAM,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;YACjE,SAAS;QACX,CAAC;QAED,GAAG,CAAC,MAAM,CAAC,IAAI,CAAC,QAAQ,iBAAiB,gDAAgD,CAAC,CAAC;IAC7F,CAAC;AACH,CAAC"}
@@ -1,10 +0,0 @@
1
- /**
2
- * @license
3
- * Copyright Google LLC All Rights Reserved.
4
- *
5
- * Use of this source code is governed by an MIT-style license that can be
6
- * found in the LICENSE file at https://angular.dev/license
7
- */
8
- import { Schema } from './schema';
9
- declare const _default: import("@angular-devkit/architect").Builder<Schema & import("@angular-devkit/core").JsonObject>;
10
- export default _default;
@@ -1,162 +0,0 @@
1
- "use strict";
2
- /**
3
- * @license
4
- * Copyright Google LLC All Rights Reserved.
5
- *
6
- * Use of this source code is governed by an MIT-style license that can be
7
- * found in the LICENSE file at https://angular.dev/license
8
- */
9
- var __importDefault = (this && this.__importDefault) || function (mod) {
10
- return (mod && mod.__esModule) ? mod : { "default": mod };
11
- };
12
- Object.defineProperty(exports, "__esModule", { value: true });
13
- const private_1 = require("@angular/build/private");
14
- const architect_1 = require("@angular-devkit/architect");
15
- const node_crypto_1 = require("node:crypto");
16
- const promises_1 = __importDefault(require("node:fs/promises"));
17
- const node_module_1 = require("node:module");
18
- const node_path_1 = __importDefault(require("node:path"));
19
- const test_files_1 = require("../../utils/test-files");
20
- const schema_1 = require("../browser-esbuild/schema");
21
- const builder_status_warnings_1 = require("./builder-status-warnings");
22
- const options_1 = require("./options");
23
- const write_test_files_1 = require("./write-test-files");
24
- exports.default = (0, architect_1.createBuilder)(async (schema, ctx) => {
25
- ctx.logger.warn('NOTE: The Web Test Runner builder is currently EXPERIMENTAL and will be removed in version 22.');
26
- (0, builder_status_warnings_1.logBuilderStatusWarnings)(schema, ctx);
27
- // Dynamic import `@web/test-runner` from the user's workspace. As an optional peer dep, it may not be installed
28
- // and may not be resolvable from `@angular-devkit/build-angular`.
29
- const require = (0, node_module_1.createRequire)(`${ctx.workspaceRoot}/`);
30
- let wtr;
31
- try {
32
- wtr = require('@web/test-runner');
33
- }
34
- catch {
35
- return {
36
- success: false,
37
- // TODO(dgp1130): Display a more accurate message for non-NPM users.
38
- error: 'Web Test Runner is not installed, most likely you need to run `npm install @web/test-runner --save-dev` in your project.',
39
- };
40
- }
41
- const options = (0, options_1.normalizeOptions)(schema);
42
- const testDir = node_path_1.default.join(ctx.workspaceRoot, 'dist/test-out', (0, node_crypto_1.randomUUID)());
43
- // Parallelize startup work.
44
- const [testFiles] = await Promise.all([
45
- // Glob for files to test.
46
- (0, test_files_1.findTestFiles)(options.include, options.exclude, ctx.workspaceRoot),
47
- // Clean build output path.
48
- promises_1.default.rm(testDir, { recursive: true, force: true }),
49
- ]);
50
- // Build the tests and abort on any build failure.
51
- const buildOutput = await buildTests(testFiles, testDir, options, ctx);
52
- if (buildOutput.kind === private_1.ResultKind.Failure) {
53
- return { success: false };
54
- }
55
- else if (buildOutput.kind !== private_1.ResultKind.Full) {
56
- return {
57
- success: false,
58
- error: 'A full build result is required from the application builder.',
59
- };
60
- }
61
- // Write test files
62
- await (0, write_test_files_1.writeTestFiles)(buildOutput.files, testDir);
63
- // Run the built tests.
64
- return await runTests(wtr, testDir, options);
65
- });
66
- /** Build all the given test files and write the result to the given output path. */
67
- async function buildTests(testFiles, outputPath, options, ctx) {
68
- const entryPoints = new Set([
69
- ...testFiles,
70
- 'jasmine-core/lib/jasmine-core/jasmine.js',
71
- '@angular-devkit/build-angular/src/builders/web-test-runner/jasmine_runner.js',
72
- ]);
73
- // Extract `zone.js/testing` to a separate entry point because it needs to be loaded after Jasmine.
74
- const [polyfills, hasZoneTesting] = extractZoneTesting(options.polyfills);
75
- if (hasZoneTesting) {
76
- entryPoints.add('zone.js/testing');
77
- }
78
- // Build tests with `application` builder, using test files as entry points.
79
- // Also bundle in Jasmine and the Jasmine runner script, which need to share chunked dependencies.
80
- const buildOutput = await first((0, private_1.buildApplicationInternal)({
81
- entryPoints,
82
- tsConfig: options.tsConfig,
83
- outputPath,
84
- aot: options.aot,
85
- index: false,
86
- outputHashing: schema_1.OutputHashing.None,
87
- optimization: false,
88
- externalDependencies: [
89
- // Resolved by `@web/test-runner` at runtime with dynamically generated code.
90
- '@web/test-runner-core',
91
- ],
92
- sourceMap: {
93
- scripts: true,
94
- styles: true,
95
- vendor: true,
96
- },
97
- polyfills,
98
- }, ctx));
99
- return buildOutput;
100
- }
101
- function extractZoneTesting(polyfills) {
102
- const polyfillsWithoutZoneTesting = polyfills.filter((polyfill) => polyfill !== 'zone.js/testing');
103
- const hasZoneTesting = polyfills.length !== polyfillsWithoutZoneTesting.length;
104
- return [polyfillsWithoutZoneTesting, hasZoneTesting];
105
- }
106
- /** Run Web Test Runner on the given directory of bundled JavaScript tests. */
107
- async function runTests(wtr, testDir, options) {
108
- const testPagePath = node_path_1.default.resolve(__dirname, 'test_page.html');
109
- const testPage = await promises_1.default.readFile(testPagePath, 'utf8');
110
- const runner = await wtr.startTestRunner({
111
- config: {
112
- rootDir: testDir,
113
- files: [
114
- `${testDir}/**/*.js`,
115
- `!${testDir}/polyfills.js`,
116
- `!${testDir}/chunk-*.js`,
117
- `!${testDir}/jasmine.js`,
118
- `!${testDir}/jasmine_runner.js`,
119
- `!${testDir}/testing.js`, // `zone.js/testing`
120
- ],
121
- testFramework: {
122
- config: {
123
- defaultTimeoutInterval: 5_000,
124
- },
125
- },
126
- nodeResolve: true,
127
- port: 9876,
128
- watch: options.watch ?? false,
129
- testRunnerHtml: (_testFramework, _config) => testPage,
130
- },
131
- readCliArgs: false,
132
- readFileConfig: false,
133
- autoExitProcess: false,
134
- });
135
- if (!runner) {
136
- throw new Error('Failed to start Web Test Runner.');
137
- }
138
- // Wait for the tests to complete and stop the runner.
139
- const passed = (await once(runner, 'finished'));
140
- await runner.stop();
141
- // No need to return error messages because Web Test Runner already printed them to the console.
142
- return { success: passed };
143
- }
144
- /** Returns the first item yielded by the given generator and cancels the execution. */
145
- async function first(generator) {
146
- for await (const value of generator) {
147
- return value;
148
- }
149
- throw new Error('Expected generator to emit at least once.');
150
- }
151
- /** Listens for a single emission of an event and returns the value emitted. */
152
- // eslint-disable-next-line @typescript-eslint/no-explicit-any
153
- function once(emitter, event) {
154
- return new Promise((resolve) => {
155
- const onEmit = (arg) => {
156
- emitter.off(event, onEmit);
157
- resolve(arg);
158
- };
159
- emitter.on(event, onEmit);
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+0,0 @@
1
- /**
2
- * @license
3
- * Copyright Google LLC All Rights Reserved.
4
- *
5
- * Use of this source code is governed by an MIT-style license that can be
6
- * found in the LICENSE file at https://angular.dev/license
7
- */
8
-
9
- import { NgModule } from '@angular/core';
10
- import { getTestBed } from '@angular/core/testing';
11
- import { BrowserTestingModule, platformBrowserTesting } from '@angular/platform-browser/testing';
12
- import {
13
- getConfig,
14
- sessionFailed,
15
- sessionFinished,
16
- sessionStarted,
17
- } from '@web/test-runner-core/browser/session.js';
18
-
19
- /** Executes Angular Jasmine tests in the given environment and reports the results to Web Test Runner. */
20
- export async function runJasmineTests(jasmineEnv) {
21
- const allSpecs = [];
22
- const failedSpecs = [];
23
-
24
- jasmineEnv.addReporter({
25
- specDone(result) {
26
- const expectations = [...result.passedExpectations, ...result.failedExpectations];
27
- allSpecs.push(...expectations.map((e) => ({ name: e.fullName, passed: e.passed })));
28
-
29
- for (const e of result.failedExpectations) {
30
- const message = `${result.fullName}\n${e.message}\n${e.stack}`;
31
- // eslint-disable-next-line no-console
32
- console.error(message);
33
- failedSpecs.push({
34
- message,
35
- name: e.fullName,
36
- stack: e.stack,
37
- expected: e.expected,
38
- actual: e.actual,
39
- });
40
- }
41
- },
42
-
43
- async jasmineDone(result) {
44
- // eslint-disable-next-line no-console
45
- console.log(`Tests ${result.overallStatus}!`);
46
- await sessionFinished({
47
- passed: result.overallStatus === 'passed',
48
- errors: failedSpecs,
49
- testResults: {
50
- name: '',
51
- suites: [],
52
- tests: allSpecs,
53
- },
54
- });
55
- },
56
- });
57
-
58
- await sessionStarted();
59
-
60
- // Web Test Runner uses a different HTML page for every test, so we only get one `testFile` for the single `*.js` file we need to execute.
61
- const { testFile, testFrameworkConfig } = await getConfig();
62
- const config = { defaultTimeoutInterval: 60_000, ...(testFrameworkConfig ?? {}) };
63
-
64
- // eslint-disable-next-line no-undef
65
- jasmine.DEFAULT_TIMEOUT_INTERVAL = config.defaultTimeoutInterval;
66
-
67
- @NgModule({
68
- providers: [typeof window.Zone !== 'undefined' ? provideZoneChangeDetection() : []],
69
- })
70
- class TestModule {}
71
-
72
- // Initialize `TestBed` automatically for users. This assumes we already evaluated `zone.js/testing`.
73
- getTestBed().initTestEnvironment([BrowserTestingModule, TestModule], platformBrowserTesting(), {
74
- errorOnUnknownElements: true,
75
- errorOnUnknownProperties: true,
76
- });
77
-
78
- // Load the test file and evaluate it.
79
- try {
80
- // eslint-disable-next-line no-undef
81
- await import(new URL(testFile, document.baseURI).href);
82
-
83
- // Execute the test functions.
84
- // eslint-disable-next-line no-undef
85
- jasmineEnv.execute();
86
- } catch (err) {
87
- // eslint-disable-next-line no-console
88
- console.error(err);
89
- await sessionFailed(err);
90
- }
91
- }
@@ -1,24 +0,0 @@
1
- /**
2
- * @license
3
- * Copyright Google LLC All Rights Reserved.
4
- *
5
- * Use of this source code is governed by an MIT-style license that can be
6
- * found in the LICENSE file at https://angular.dev/license
7
- */
8
- import { Schema as WtrBuilderSchema } from './schema';
9
- /**
10
- * Options supported for the Web Test Runner builder. The schema is an approximate
11
- * representation of the options type, but this is a more precise version.
12
- */
13
- export type WtrBuilderOptions = Overwrite<WtrBuilderSchema, {
14
- include: string[];
15
- exclude: string[];
16
- polyfills: string[];
17
- }>;
18
- type Overwrite<Obj extends {}, Overrides extends {}> = Omit<Obj, keyof Overrides> & Overrides;
19
- /**
20
- * Normalizes input options validated by the schema to a more precise and useful
21
- * options type in {@link WtrBuilderOptions}.
22
- */
23
- export declare function normalizeOptions(schema: WtrBuilderSchema): WtrBuilderOptions;
24
- export {};
@@ -1,26 +0,0 @@
1
- "use strict";
2
- /**
3
- * @license
4
- * Copyright Google LLC All Rights Reserved.
5
- *
6
- * Use of this source code is governed by an MIT-style license that can be
7
- * found in the LICENSE file at https://angular.dev/license
8
- */
9
- Object.defineProperty(exports, "__esModule", { value: true });
10
- exports.normalizeOptions = normalizeOptions;
11
- /**
12
- * Normalizes input options validated by the schema to a more precise and useful
13
- * options type in {@link WtrBuilderOptions}.
14
- */
15
- function normalizeOptions(schema) {
16
- return {
17
- ...schema,
18
- // Options with default values can't actually be null, even if the types say so.
19
- /* eslint-disable @typescript-eslint/no-non-null-assertion */
20
- include: schema.include,
21
- exclude: schema.exclude,
22
- /* eslint-enable @typescript-eslint/no-non-null-assertion */
23
- polyfills: typeof schema.polyfills === 'string' ? [schema.polyfills] : schema.polyfills ?? [],
24
- };
25
- }
26
- //# sourceMappingURL=options.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"options.js","sourceRoot":"","sources":["options.ts"],"names":[],"mappings":";AAAA;;;;;;GAMG;;AAuBH,4CAYC;AAhBD;;;GAGG;AACH,SAAgB,gBAAgB,CAAC,MAAwB;IACvD,OAAO;QACL,GAAG,MAAM;QAET,gFAAgF;QAChF,6DAA6D;QAC7D,OAAO,EAAE,MAAM,CAAC,OAAQ;QACxB,OAAO,EAAE,MAAM,CAAC,OAAQ;QACxB,4DAA4D;QAE5D,SAAS,EAAE,OAAO,MAAM,CAAC,SAAS,KAAK,QAAQ,CAAC,CAAC,CAAC,CAAC,MAAM,CAAC,SAAS,CAAC,CAAC,CAAC,CAAC,MAAM,CAAC,SAAS,IAAI,EAAE;KAC9F,CAAC;AACJ,CAAC"}