mirror of
https://github.com/angular/angular
synced 2026-05-24 09:28:37 +00:00
build: migrate all ts_library in packages/core/test (#61472)
This commit migrates all `ts_library` in `package/core/test` to `ts_project`, and fixes deep module, or relative imports inside. PR Close #61472
This commit is contained in:
parent
3a106a35bc
commit
8ead19fe00
65 changed files with 316 additions and 218 deletions
|
|
@ -1,4 +1,5 @@
|
|||
load("//tools:defaults.bzl", "jasmine_node_test", "karma_web_test_suite", "ts_library")
|
||||
load("//tools:defaults.bzl", "jasmine_node_test", "karma_web_test_suite")
|
||||
load("//tools:defaults2.bzl", "ts_project")
|
||||
|
||||
package(default_visibility = ["//visibility:public"])
|
||||
|
||||
|
|
@ -23,17 +24,19 @@ UTILS = [
|
|||
"linker/source_map_util.ts",
|
||||
]
|
||||
|
||||
ts_library(
|
||||
ts_project(
|
||||
name = "test_utils",
|
||||
testonly = True,
|
||||
srcs = UTILS,
|
||||
deps = [
|
||||
interop_deps = [
|
||||
"//packages/compiler",
|
||||
"@npm//source-map",
|
||||
],
|
||||
deps = [
|
||||
"//:node_modules/source-map",
|
||||
],
|
||||
)
|
||||
|
||||
ts_library(
|
||||
ts_project(
|
||||
name = "test_lib",
|
||||
testonly = True,
|
||||
srcs = glob(
|
||||
|
|
@ -43,10 +46,7 @@ ts_library(
|
|||
"reflection/es2015_inheritance_fixture.ts",
|
||||
],
|
||||
),
|
||||
# Visible to //:saucelabs_unit_tests_poc target
|
||||
visibility = ["//:__pkg__"],
|
||||
deps = [
|
||||
":test_utils",
|
||||
interop_deps = [
|
||||
"//packages/animations",
|
||||
"//packages/animations/browser",
|
||||
"//packages/animations/browser/testing",
|
||||
|
|
@ -69,20 +69,23 @@ ts_library(
|
|||
"//packages/router",
|
||||
"//packages/router/testing",
|
||||
"//packages/zone.js/lib:zone_d_ts",
|
||||
"@npm//rxjs",
|
||||
],
|
||||
# Visible to //:saucelabs_unit_tests_poc target
|
||||
visibility = ["//:__pkg__"],
|
||||
deps = [
|
||||
":test_utils_rjs",
|
||||
"//:node_modules/rxjs",
|
||||
],
|
||||
)
|
||||
|
||||
ts_library(
|
||||
ts_project(
|
||||
name = "test_node_only_lib",
|
||||
testonly = True,
|
||||
srcs = glob(
|
||||
["**/*_node_only_spec.ts"],
|
||||
exclude = UTILS,
|
||||
),
|
||||
deps = [
|
||||
":test_lib",
|
||||
":test_utils",
|
||||
interop_deps = [
|
||||
"//packages/compiler",
|
||||
"//packages/core",
|
||||
"//packages/core/src/compiler",
|
||||
|
|
@ -91,6 +94,10 @@ ts_library(
|
|||
"//packages/platform-server/testing",
|
||||
"//packages/private/testing",
|
||||
],
|
||||
deps = [
|
||||
":test_lib_rjs",
|
||||
":test_utils_rjs",
|
||||
],
|
||||
)
|
||||
|
||||
jasmine_node_test(
|
||||
|
|
|
|||
|
|
@ -1,4 +1,5 @@
|
|||
load("//tools:defaults.bzl", "jasmine_node_test", "karma_web_test_suite", "ng_module", "ts_library")
|
||||
load("//tools:defaults.bzl", "jasmine_node_test", "karma_web_test_suite", "ng_module")
|
||||
load("//tools:defaults2.bzl", "ts_project")
|
||||
|
||||
package(default_visibility = ["//visibility:private"])
|
||||
|
||||
|
|
@ -6,16 +7,14 @@ SPEC_FILES_WITH_FORWARD_REFS = [
|
|||
"di_forward_ref_spec.ts",
|
||||
]
|
||||
|
||||
ts_library(
|
||||
ts_project(
|
||||
name = "acceptance_lib",
|
||||
testonly = True,
|
||||
srcs = glob(
|
||||
["**/*.ts"],
|
||||
exclude = SPEC_FILES_WITH_FORWARD_REFS,
|
||||
),
|
||||
# Visible to //:saucelabs_unit_tests
|
||||
visibility = ["//:__pkg__"],
|
||||
deps = [
|
||||
interop_deps = [
|
||||
"//packages/animations",
|
||||
"//packages/animations/browser",
|
||||
"//packages/animations/browser/testing",
|
||||
|
|
@ -38,7 +37,11 @@ ts_library(
|
|||
"//packages/private/testing",
|
||||
"//packages/router",
|
||||
"//packages/zone.js/lib:zone_d_ts",
|
||||
"@npm//rxjs",
|
||||
],
|
||||
# Visible to //:saucelabs_unit_tests
|
||||
visibility = ["//:__pkg__"],
|
||||
deps = [
|
||||
"//:node_modules/rxjs",
|
||||
],
|
||||
)
|
||||
|
||||
|
|
|
|||
|
|
@ -6,7 +6,10 @@
|
|||
* found in the LICENSE file at https://angular.dev/license
|
||||
*/
|
||||
|
||||
import {PLATFORM_BROWSER_ID, PLATFORM_SERVER_ID} from '@angular/common/src/platform_id';
|
||||
import {
|
||||
ɵPLATFORM_BROWSER_ID as PLATFORM_BROWSER_ID,
|
||||
ɵPLATFORM_SERVER_ID as PLATFORM_SERVER_ID,
|
||||
} from '@angular/common';
|
||||
import {
|
||||
AfterRenderRef,
|
||||
ApplicationRef,
|
||||
|
|
|
|||
|
|
@ -1,4 +1,5 @@
|
|||
load("//tools:defaults.bzl", "jasmine_node_test", "karma_web_test_suite", "ng_module", "nodejs_binary", "npm_package_bin", "ts_library")
|
||||
load("//tools:defaults.bzl", "jasmine_node_test", "karma_web_test_suite", "ng_module", "nodejs_binary", "npm_package_bin")
|
||||
load("//tools:defaults2.bzl", "ts_project")
|
||||
|
||||
package(default_visibility = ["//visibility:private"])
|
||||
|
||||
|
|
@ -13,20 +14,21 @@ TEST_DEPS = [
|
|||
"//packages/core/testing",
|
||||
"//packages/platform-browser",
|
||||
"//packages/core/primitives/signals",
|
||||
"@npm//rxjs",
|
||||
]
|
||||
|
||||
ts_library(
|
||||
ts_project(
|
||||
name = "test_compiler_lib",
|
||||
testonly = True,
|
||||
srcs = ["authoring_test_compiler.ts"],
|
||||
deps = [
|
||||
interop_deps = [
|
||||
"//packages/compiler-cli",
|
||||
"//packages/compiler-cli/src/ngtsc/imports",
|
||||
"//packages/compiler-cli/src/ngtsc/partial_evaluator",
|
||||
"//packages/compiler-cli/src/ngtsc/reflection",
|
||||
"//packages/compiler-cli/src/ngtsc/transform/jit",
|
||||
"@npm//typescript",
|
||||
],
|
||||
deps = [
|
||||
"//:node_modules/typescript",
|
||||
],
|
||||
)
|
||||
|
||||
|
|
@ -37,7 +39,7 @@ nodejs_binary(
|
|||
":test_compiler_lib",
|
||||
"//packages:package_json",
|
||||
],
|
||||
entry_point = ":authoring_test_compiler.ts",
|
||||
entry_point = ":authoring_test_compiler.js",
|
||||
)
|
||||
|
||||
npm_package_bin(
|
||||
|
|
@ -49,18 +51,25 @@ npm_package_bin(
|
|||
tool = ":test_compiler",
|
||||
)
|
||||
|
||||
ts_library(
|
||||
ts_project(
|
||||
name = "test_jit_lib",
|
||||
testonly = True,
|
||||
srcs = ["transformed_%s" % file for file in TEST_FILES],
|
||||
deps = TEST_DEPS,
|
||||
interop_deps = TEST_DEPS,
|
||||
deps = [
|
||||
# TODO: Only rely on `TEST_DEPS`. This should be removed during `rules_js` migration.
|
||||
"//:node_modules/rxjs",
|
||||
],
|
||||
)
|
||||
|
||||
ng_module(
|
||||
name = "test_lib",
|
||||
testonly = True,
|
||||
srcs = TEST_FILES,
|
||||
deps = TEST_DEPS,
|
||||
deps = TEST_DEPS + [
|
||||
# TODO: Only rely on `TEST_DEPS`. This should be removed during `rules_js` migration.
|
||||
"@npm//rxjs",
|
||||
],
|
||||
)
|
||||
|
||||
jasmine_node_test(
|
||||
|
|
|
|||
|
|
@ -7,7 +7,7 @@
|
|||
*/
|
||||
|
||||
import {CommonModule} from '@angular/common';
|
||||
import {expect} from '@angular/platform-browser/testing/src/matchers';
|
||||
import {expect} from '@angular/private/testing/matchers';
|
||||
import {BehaviorSubject} from 'rxjs';
|
||||
import {
|
||||
ApplicationRef,
|
||||
|
|
|
|||
|
|
@ -28,9 +28,9 @@ import {
|
|||
ViewChild,
|
||||
ViewContainerRef,
|
||||
} from '../../src/core';
|
||||
import {provideCheckNoChangesConfig} from '@angular/core/src/change_detection/provide_check_no_changes_config';
|
||||
import {provideCheckNoChangesConfig} from '../../src/change_detection/provide_check_no_changes_config';
|
||||
import {ComponentFixture, TestBed} from '../../testing';
|
||||
import {expect} from '@angular/platform-browser/testing/src/matchers';
|
||||
import {expect} from '@angular/private/testing/matchers';
|
||||
import {of} from 'rxjs';
|
||||
|
||||
describe('change detection for transplanted views', () => {
|
||||
|
|
|
|||
|
|
@ -33,7 +33,7 @@ import {
|
|||
ɵɵdefineComponent,
|
||||
} from '../../src/core';
|
||||
import {TestBed} from '../../testing';
|
||||
import {expect} from '@angular/platform-browser/testing/src/matchers';
|
||||
import {expect} from '@angular/private/testing/matchers';
|
||||
|
||||
import {global} from '../../src/util/global';
|
||||
|
||||
|
|
|
|||
|
|
@ -22,7 +22,7 @@ import {
|
|||
} from '../../src/core';
|
||||
import {TestBed} from '../../testing';
|
||||
import {By} from '@angular/platform-browser';
|
||||
import {expect} from '@angular/platform-browser/testing/src/matchers';
|
||||
import {expect} from '@angular/private/testing/matchers';
|
||||
|
||||
describe('projection', () => {
|
||||
function getElementHtml(element: HTMLElement) {
|
||||
|
|
|
|||
|
|
@ -41,10 +41,11 @@ import {getInjectorResolutionPath} from '../../src/render3/util/injector_discove
|
|||
import {ActivatedRoute, provideRouter, Router, RouterOutlet} from '@angular/router';
|
||||
import {ChainedInjector} from '../../src/render3/chained_injector';
|
||||
import {global} from '../../src/util/global';
|
||||
import {TimerScheduler} from '@angular/core/src/defer/timer_scheduler';
|
||||
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';
|
||||
|
||||
/**
|
||||
* Clears all associated directive defs from a given component class.
|
||||
|
|
|
|||
|
|
@ -38,6 +38,7 @@ import {clearTranslations, loadTranslations} from '@angular/localize';
|
|||
import {computeMsgId} from '@angular/compiler';
|
||||
import {EVENT_MANAGER_PLUGINS} from '@angular/platform-browser';
|
||||
import {ComponentType} from '../../src/render3';
|
||||
import {isNode} from '@angular/private/testing';
|
||||
|
||||
describe('hot module replacement', () => {
|
||||
it('should recreate a single usage of a basic component', () => {
|
||||
|
|
|
|||
|
|
@ -38,7 +38,7 @@ import {getComponentLView} from '../../src/render3/util/discovery_utils';
|
|||
import {DeferBlockBehavior, DeferBlockState, TestBed} from '../../testing';
|
||||
import {clearTranslations, loadTranslations} from '@angular/localize';
|
||||
import {By} from '@angular/platform-browser';
|
||||
import {expect} from '@angular/platform-browser/testing/src/matchers';
|
||||
import {expect} from '@angular/private/testing/matchers';
|
||||
import {BehaviorSubject} from 'rxjs';
|
||||
import {provideNgReflectAttributes} from '../../src/ng_reflect';
|
||||
|
||||
|
|
|
|||
|
|
@ -23,7 +23,7 @@ import {
|
|||
ViewChild,
|
||||
ViewChildren,
|
||||
} from '../../src/core';
|
||||
import {InternalInjectFlags} from '@angular/core/src/di/interface/injector';
|
||||
import {InternalInjectFlags} from '../../src/di/interface/injector';
|
||||
import {NullInjector} from '../../src/di/null_injector';
|
||||
import {
|
||||
isClassProvider,
|
||||
|
|
|
|||
|
|
@ -29,7 +29,7 @@ import {
|
|||
ɵɵinject,
|
||||
} from '../../src/core';
|
||||
import {TestBed} from '../../testing';
|
||||
import {expect} from '@angular/platform-browser/testing/src/matchers';
|
||||
import {expect} from '@angular/private/testing/matchers';
|
||||
|
||||
describe('pipe', () => {
|
||||
@Pipe({
|
||||
|
|
|
|||
|
|
@ -21,7 +21,7 @@ import {
|
|||
import {leaveView, specOnlyIsInstructionStateEmpty} from '../../src/render3/state';
|
||||
import {inject, TestBed, waitForAsync} from '../../testing';
|
||||
import {By} from '@angular/platform-browser';
|
||||
import {expect} from '@angular/platform-browser/testing/src/matchers';
|
||||
import {expect} from '@angular/private/testing/matchers';
|
||||
|
||||
describe('providers', () => {
|
||||
describe('inheritance', () => {
|
||||
|
|
|
|||
|
|
@ -13,8 +13,19 @@ import {
|
|||
ɵNoopAnimationStyleNormalizer,
|
||||
} from '@angular/animations/browser';
|
||||
import {MockAnimationDriver, MockAnimationPlayer} from '@angular/animations/browser/testing';
|
||||
import {CommonModule, DOCUMENT} from '@angular/common';
|
||||
import {PLATFORM_BROWSER_ID, PLATFORM_SERVER_ID} from '@angular/common/src/platform_id';
|
||||
import {
|
||||
CommonModule,
|
||||
DOCUMENT,
|
||||
ɵPLATFORM_BROWSER_ID as PLATFORM_BROWSER_ID,
|
||||
ɵPLATFORM_SERVER_ID as PLATFORM_SERVER_ID,
|
||||
} from '@angular/common';
|
||||
import {
|
||||
ɵDomRendererFactory2 as DomRendererFactory2,
|
||||
EventManager,
|
||||
ɵSharedStylesHost,
|
||||
} from '@angular/platform-browser';
|
||||
import {isBrowser, isNode} from '@angular/private/testing';
|
||||
import {expect} from '@angular/private/testing/matchers';
|
||||
import {
|
||||
Component,
|
||||
DoCheck,
|
||||
|
|
@ -28,9 +39,6 @@ import {
|
|||
import {RElement} from '../../src/render3/interfaces/renderer_dom';
|
||||
import {NoopNgZone} from '../../src/zone/ng_zone';
|
||||
import {TestBed} from '../../testing';
|
||||
import {EventManager, ɵSharedStylesHost} from '@angular/platform-browser';
|
||||
import {DomRendererFactory2} from '@angular/platform-browser/src/dom/dom_renderer';
|
||||
import {expect} from '@angular/platform-browser/testing/src/matchers';
|
||||
|
||||
describe('renderer factory lifecycle', () => {
|
||||
let logs: string[] = [];
|
||||
|
|
|
|||
|
|
@ -26,6 +26,7 @@ import {
|
|||
getSortedStyle,
|
||||
} from '../../testing/src/styling';
|
||||
import {By, DomSanitizer, SafeStyle} from '@angular/platform-browser';
|
||||
import {isBrowser} from '@angular/private/testing';
|
||||
|
||||
describe('styling', () => {
|
||||
describe('apply in prioritization order', () => {
|
||||
|
|
|
|||
|
|
@ -46,7 +46,7 @@ import {
|
|||
import {ComponentFixture, TestBed, TestComponentRenderer} from '../../testing';
|
||||
import {clearTranslations, loadTranslations} from '@angular/localize';
|
||||
import {By, DomSanitizer} from '@angular/platform-browser';
|
||||
import {expect} from '@angular/platform-browser/testing/src/matchers';
|
||||
import {expect} from '@angular/private/testing/matchers';
|
||||
|
||||
describe('ViewContainerRef', () => {
|
||||
/**
|
||||
|
|
|
|||
|
|
@ -43,7 +43,7 @@ import {
|
|||
BrowserAnimationsModule,
|
||||
NoopAnimationsModule,
|
||||
} from '@angular/platform-browser/animations';
|
||||
import {hasStyle} from '@angular/platform-browser/testing/src/browser_util';
|
||||
import {hasStyle, isNode} from '@angular/private/testing';
|
||||
|
||||
const DEFAULT_NAMESPACE_ID = 'id';
|
||||
const DEFAULT_COMPONENT_ID = '1';
|
||||
|
|
|
|||
|
|
@ -24,14 +24,16 @@ import {
|
|||
AnimationDriver,
|
||||
ɵAnimationEngine,
|
||||
ɵnormalizeKeyframes as normalizeKeyframes,
|
||||
ɵTransitionAnimationPlayer as TransitionAnimationPlayer,
|
||||
ɵENTER_CLASSNAME as ENTER_CLASSNAME,
|
||||
ɵLEAVE_CLASSNAME as LEAVE_CLASSNAME,
|
||||
} from '@angular/animations/browser';
|
||||
import {TransitionAnimationPlayer} from '@angular/animations/browser/src/render/transition_animation_engine';
|
||||
import {ENTER_CLASSNAME, LEAVE_CLASSNAME} from '@angular/animations/browser/src/util';
|
||||
import {MockAnimationDriver, MockAnimationPlayer} from '@angular/animations/browser/testing';
|
||||
import {CommonModule} from '@angular/common';
|
||||
import {Component, HostBinding, ViewChild} from '../../src/core';
|
||||
import {fakeAsync, flushMicrotasks, TestBed} from '../../testing';
|
||||
import {BrowserAnimationsModule} from '@angular/platform-browser/animations';
|
||||
import {isNode} from '@angular/private/testing';
|
||||
|
||||
import {HostListener} from '../../src/metadata/directives';
|
||||
|
||||
|
|
|
|||
|
|
@ -16,13 +16,17 @@ import {
|
|||
trigger,
|
||||
ɵAnimationGroupPlayer as AnimationGroupPlayer,
|
||||
} from '@angular/animations';
|
||||
import {AnimationDriver, ɵAnimationEngine} from '@angular/animations/browser';
|
||||
import {TransitionAnimationPlayer} from '@angular/animations/browser/src/render/transition_animation_engine';
|
||||
import {
|
||||
AnimationDriver,
|
||||
ɵAnimationEngine,
|
||||
ɵTransitionAnimationPlayer as TransitionAnimationPlayer,
|
||||
} from '@angular/animations/browser';
|
||||
import {MockAnimationDriver, MockAnimationPlayer} from '@angular/animations/browser/testing';
|
||||
import {Component, HostBinding} from '../../src/core';
|
||||
import {fakeAsync, flushMicrotasks, TestBed, tick} from '../../testing';
|
||||
import {BrowserAnimationsModule} from '@angular/platform-browser/animations';
|
||||
import {ActivatedRoute, Router, RouterModule, RouterOutlet} from '@angular/router';
|
||||
import {isNode} from '@angular/private/testing';
|
||||
|
||||
(function () {
|
||||
// these tests are only meant to be run within the DOM (for now)
|
||||
|
|
|
|||
|
|
@ -5,18 +5,26 @@
|
|||
* 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 {animate, query, state, style, transition, trigger} from '@angular/animations';
|
||||
import {
|
||||
animate,
|
||||
query,
|
||||
state,
|
||||
style,
|
||||
transition,
|
||||
trigger,
|
||||
ɵAnimationGroupPlayer as AnimationGroupPlayer,
|
||||
} from '@angular/animations';
|
||||
import {
|
||||
AnimationDriver,
|
||||
ɵAnimationEngine,
|
||||
ɵWebAnimationsDriver,
|
||||
ɵWebAnimationsPlayer,
|
||||
ɵTransitionAnimationPlayer as TransitionAnimationPlayer,
|
||||
} from '@angular/animations/browser';
|
||||
import {TransitionAnimationPlayer} from '@angular/animations/browser/src/render/transition_animation_engine';
|
||||
import {AnimationGroupPlayer} from '@angular/animations/src/players/animation_group_player';
|
||||
import {Component, ViewChild} from '../../src/core';
|
||||
import {TestBed} from '../../testing';
|
||||
import {BrowserAnimationsModule} from '@angular/platform-browser/animations';
|
||||
import {isNode} from '@angular/private/testing';
|
||||
|
||||
(function () {
|
||||
// these tests are only meant to be run within the DOM (for now)
|
||||
|
|
|
|||
|
|
@ -8,12 +8,18 @@
|
|||
|
||||
import {DOCUMENT, ɵgetDOM as getDOM} from '@angular/common';
|
||||
import {ResourceLoader} from '@angular/compiler';
|
||||
import {
|
||||
BrowserModule,
|
||||
ɵDomRendererFactory2 as DomRendererFactory2,
|
||||
} from '@angular/platform-browser';
|
||||
import type {ServerModule} from '@angular/platform-server';
|
||||
import {createTemplate, dispatchEvent, getContent, isNode} from '@angular/private/testing';
|
||||
import {expect} from '@angular/private/testing/matchers';
|
||||
import {
|
||||
APP_BOOTSTRAP_LISTENER,
|
||||
APP_INITIALIZER,
|
||||
ChangeDetectionStrategy,
|
||||
Compiler,
|
||||
CompilerFactory,
|
||||
Component,
|
||||
EnvironmentInjector,
|
||||
InjectionToken,
|
||||
|
|
@ -32,21 +38,12 @@ import {
|
|||
import {ErrorHandler} from '../src/error_handler';
|
||||
import {ComponentRef} from '../src/linker/component_factory';
|
||||
import {createEnvironmentInjector, getLocaleId} from '../src/render3';
|
||||
import {BrowserModule} from '@angular/platform-browser';
|
||||
import {DomRendererFactory2} from '@angular/platform-browser/src/dom/dom_renderer';
|
||||
import {
|
||||
createTemplate,
|
||||
dispatchEvent,
|
||||
getContent,
|
||||
} from '@angular/platform-browser/testing/src/browser_util';
|
||||
import {expect} from '@angular/platform-browser/testing/src/matchers';
|
||||
import type {ServerModule} from '@angular/platform-server';
|
||||
|
||||
import {take} from 'rxjs/operators';
|
||||
import {compileNgModuleFactory} from '../src/application/application_ngmodule_factory_compiler';
|
||||
import {ApplicationRef} from '../src/application/application_ref';
|
||||
import {NoopNgZone} from '../src/zone/ng_zone';
|
||||
import {ComponentFixtureNoNgZone, inject, TestBed, waitForAsync, withModule} from '../testing';
|
||||
import {take} from 'rxjs/operators';
|
||||
import {compileNgModuleFactory} from '../src/application/application_ngmodule_factory_compiler';
|
||||
|
||||
let serverPlatformModule: Promise<Type<ServerModule>> | null = null;
|
||||
if (isNode) {
|
||||
|
|
|
|||
|
|
@ -1,6 +1,7 @@
|
|||
load("//tools:defaults.bzl", "jasmine_node_test", "karma_web_test_suite", "nodejs_test", "ts_library")
|
||||
load("//tools:defaults.bzl", "jasmine_node_test", "karma_web_test_suite", "nodejs_test")
|
||||
load("//tools:defaults2.bzl", "ts_project")
|
||||
|
||||
ts_library(
|
||||
ts_project(
|
||||
name = "signal_authoring_signature_test_lib",
|
||||
testonly = True,
|
||||
srcs = [
|
||||
|
|
@ -10,35 +11,46 @@ ts_library(
|
|||
"signal_queries_signature_test.ts",
|
||||
"unwrap_writable_signal_signature_test.ts",
|
||||
],
|
||||
deps = ["//packages/core"],
|
||||
interop_deps = ["//packages/core"],
|
||||
)
|
||||
|
||||
ts_library(
|
||||
ts_project(
|
||||
name = "type_tester_lib",
|
||||
testonly = True,
|
||||
srcs = ["type_tester.ts"],
|
||||
deps = [
|
||||
"@npm//typescript",
|
||||
"//:node_modules/typescript",
|
||||
],
|
||||
)
|
||||
|
||||
filegroup(
|
||||
name = "types",
|
||||
testonly = True,
|
||||
srcs = [
|
||||
":signal_authoring_signature_test_lib_rjs",
|
||||
":type_tester_lib_rjs",
|
||||
],
|
||||
output_group = "types",
|
||||
)
|
||||
|
||||
nodejs_test(
|
||||
name = "type_test",
|
||||
data = [
|
||||
":signal_authoring_signature_test_lib",
|
||||
":type_tester_lib",
|
||||
":types",
|
||||
"//packages:package_json",
|
||||
],
|
||||
entry_point = ":type_tester.ts",
|
||||
entry_point = ":type_tester.js",
|
||||
)
|
||||
|
||||
ts_library(
|
||||
ts_project(
|
||||
name = "test_lib",
|
||||
testonly = True,
|
||||
srcs = [
|
||||
"input_signal_spec.ts",
|
||||
"model_input_spec.ts",
|
||||
],
|
||||
deps = [
|
||||
interop_deps = [
|
||||
"//packages/core",
|
||||
"//packages/core/primitives/signals",
|
||||
"//packages/core/testing",
|
||||
|
|
|
|||
|
|
@ -1,6 +1,7 @@
|
|||
load("//tools:defaults.bzl", "app_bundle", "jasmine_node_test", "ng_module", "ts_library")
|
||||
load("//tools/symbol-extractor:index.bzl", "js_expected_symbol_test")
|
||||
load("@npm//http-server:index.bzl", "http_server")
|
||||
load("//tools:defaults.bzl", "app_bundle", "jasmine_node_test", "ng_module")
|
||||
load("//tools:defaults2.bzl", "ts_project")
|
||||
load("//tools/symbol-extractor:index.bzl", "js_expected_symbol_test")
|
||||
|
||||
package(default_visibility = ["//visibility:public"])
|
||||
|
||||
|
|
@ -23,17 +24,18 @@ app_bundle(
|
|||
],
|
||||
)
|
||||
|
||||
ts_library(
|
||||
ts_project(
|
||||
name = "test_lib",
|
||||
testonly = True,
|
||||
srcs = glob(["*_spec.ts"]),
|
||||
deps = [
|
||||
"//packages:types",
|
||||
interop_deps = [
|
||||
"//packages/compiler",
|
||||
"//packages/core",
|
||||
"//packages/core/testing",
|
||||
"//packages/private/testing",
|
||||
"@npm//@bazel/runfiles",
|
||||
],
|
||||
deps = [
|
||||
"//:node_modules/@bazel/runfiles",
|
||||
],
|
||||
)
|
||||
|
||||
|
|
|
|||
|
|
@ -1,15 +1,16 @@
|
|||
load("//tools:defaults.bzl", "app_bundle", "ts_library")
|
||||
load("@npm//@angular/build-tooling/bazel/map-size-tracking:index.bzl", "js_mapping_size_test")
|
||||
load("//tools:defaults.bzl", "app_bundle")
|
||||
load("//tools:defaults2.bzl", "ts_project")
|
||||
|
||||
package(default_visibility = ["//visibility:public"])
|
||||
|
||||
ts_library(
|
||||
ts_project(
|
||||
name = "core_all",
|
||||
srcs = ["index.ts"],
|
||||
tags = [],
|
||||
deps = [
|
||||
interop_deps = [
|
||||
"//packages/core",
|
||||
],
|
||||
tags = [],
|
||||
)
|
||||
|
||||
app_bundle(
|
||||
|
|
|
|||
|
|
@ -1,5 +1,6 @@
|
|||
load("@npm//http-server:index.bzl", "http_server")
|
||||
load("//tools:defaults.bzl", "app_bundle", "jasmine_node_test", "ng_module", "ts_library")
|
||||
load("//tools:defaults.bzl", "app_bundle", "jasmine_node_test", "ng_module")
|
||||
load("//tools:defaults2.bzl", "ts_project")
|
||||
|
||||
package(default_visibility = ["//visibility:public"])
|
||||
|
||||
|
|
@ -25,16 +26,17 @@ app_bundle(
|
|||
],
|
||||
)
|
||||
|
||||
ts_library(
|
||||
ts_project(
|
||||
name = "test_lib",
|
||||
testonly = True,
|
||||
srcs = glob(["*_spec.ts"]),
|
||||
deps = [
|
||||
"//packages:types",
|
||||
interop_deps = [
|
||||
"//packages/compiler",
|
||||
"//packages/core/testing",
|
||||
"//packages/private/testing",
|
||||
"@npm//@bazel/runfiles",
|
||||
],
|
||||
deps = [
|
||||
"//:node_modules/@bazel/runfiles",
|
||||
],
|
||||
)
|
||||
|
||||
|
|
|
|||
|
|
@ -1,6 +1,7 @@
|
|||
load("//tools:defaults.bzl", "app_bundle", "jasmine_node_test", "ng_module", "ts_library")
|
||||
load("//tools/symbol-extractor:index.bzl", "js_expected_symbol_test")
|
||||
load("@npm//http-server:index.bzl", "http_server")
|
||||
load("//tools:defaults.bzl", "app_bundle", "jasmine_node_test", "ng_module")
|
||||
load("//tools:defaults2.bzl", "ts_project")
|
||||
load("//tools/symbol-extractor:index.bzl", "js_expected_symbol_test")
|
||||
|
||||
package(default_visibility = ["//visibility:public"])
|
||||
|
||||
|
|
@ -27,16 +28,17 @@ app_bundle(
|
|||
],
|
||||
)
|
||||
|
||||
ts_library(
|
||||
ts_project(
|
||||
name = "test_lib",
|
||||
testonly = True,
|
||||
srcs = glob(["*_spec.ts"]),
|
||||
deps = [
|
||||
"//packages:types",
|
||||
interop_deps = [
|
||||
"//packages/compiler",
|
||||
"//packages/core/testing",
|
||||
"//packages/private/testing",
|
||||
"@npm//@bazel/runfiles",
|
||||
],
|
||||
deps = [
|
||||
"//:node_modules/@bazel/runfiles",
|
||||
],
|
||||
)
|
||||
|
||||
|
|
|
|||
|
|
@ -1,6 +1,7 @@
|
|||
load("//tools:defaults.bzl", "app_bundle", "jasmine_node_test", "ng_module", "ts_library")
|
||||
load("//tools/symbol-extractor:index.bzl", "js_expected_symbol_test")
|
||||
load("@npm//http-server:index.bzl", "http_server")
|
||||
load("//tools:defaults.bzl", "app_bundle", "jasmine_node_test", "ng_module")
|
||||
load("//tools:defaults2.bzl", "ts_project")
|
||||
load("//tools/symbol-extractor:index.bzl", "js_expected_symbol_test")
|
||||
|
||||
package(default_visibility = ["//visibility:public"])
|
||||
|
||||
|
|
@ -26,17 +27,18 @@ app_bundle(
|
|||
],
|
||||
)
|
||||
|
||||
ts_library(
|
||||
ts_project(
|
||||
name = "test_lib",
|
||||
testonly = True,
|
||||
srcs = glob(["*_spec.ts"]),
|
||||
deps = [
|
||||
"//packages:types",
|
||||
interop_deps = [
|
||||
"//packages/compiler",
|
||||
"//packages/core",
|
||||
"//packages/core/testing",
|
||||
"//packages/private/testing",
|
||||
"@npm//@bazel/runfiles",
|
||||
],
|
||||
deps = [
|
||||
"//:node_modules/@bazel/runfiles",
|
||||
],
|
||||
)
|
||||
|
||||
|
|
|
|||
|
|
@ -1,6 +1,7 @@
|
|||
load("//tools:defaults.bzl", "app_bundle", "jasmine_node_test", "ng_module", "ts_library")
|
||||
load("//tools/symbol-extractor:index.bzl", "js_expected_symbol_test")
|
||||
load("@npm//http-server:index.bzl", "http_server")
|
||||
load("//tools:defaults.bzl", "app_bundle", "jasmine_node_test", "ng_module")
|
||||
load("//tools:defaults2.bzl", "ts_project")
|
||||
load("//tools/symbol-extractor:index.bzl", "js_expected_symbol_test")
|
||||
|
||||
package(default_visibility = ["//visibility:public"])
|
||||
|
||||
|
|
@ -26,17 +27,18 @@ app_bundle(
|
|||
],
|
||||
)
|
||||
|
||||
ts_library(
|
||||
ts_project(
|
||||
name = "test_lib",
|
||||
testonly = True,
|
||||
srcs = glob(["*_spec.ts"]),
|
||||
deps = [
|
||||
"//packages:types",
|
||||
interop_deps = [
|
||||
"//packages/compiler",
|
||||
"//packages/core",
|
||||
"//packages/core/testing",
|
||||
"//packages/private/testing",
|
||||
"@npm//@bazel/runfiles",
|
||||
],
|
||||
deps = [
|
||||
"//:node_modules/@bazel/runfiles",
|
||||
],
|
||||
)
|
||||
|
||||
|
|
|
|||
|
|
@ -1,6 +1,7 @@
|
|||
load("//tools:defaults.bzl", "app_bundle", "jasmine_node_test", "ng_module", "ts_library")
|
||||
load("//tools/symbol-extractor:index.bzl", "js_expected_symbol_test")
|
||||
load("@npm//http-server:index.bzl", "http_server")
|
||||
load("//tools:defaults.bzl", "app_bundle", "jasmine_node_test", "ng_module")
|
||||
load("//tools:defaults2.bzl", "ts_project")
|
||||
load("//tools/symbol-extractor:index.bzl", "js_expected_symbol_test")
|
||||
|
||||
package(default_visibility = ["//visibility:public"])
|
||||
|
||||
|
|
@ -24,16 +25,17 @@ app_bundle(
|
|||
],
|
||||
)
|
||||
|
||||
ts_library(
|
||||
ts_project(
|
||||
name = "test_lib",
|
||||
testonly = True,
|
||||
srcs = glob(["*_spec.ts"]),
|
||||
deps = [
|
||||
"//packages:types",
|
||||
interop_deps = [
|
||||
"//packages/compiler",
|
||||
"//packages/core/testing",
|
||||
"//packages/private/testing",
|
||||
"@npm//@bazel/runfiles",
|
||||
],
|
||||
deps = [
|
||||
"//:node_modules/@bazel/runfiles",
|
||||
],
|
||||
)
|
||||
|
||||
|
|
|
|||
|
|
@ -1,4 +1,5 @@
|
|||
load("//tools:defaults.bzl", "esbuild", "http_server", "ng_module", "protractor_web_test_suite", "ts_library")
|
||||
load("//tools:defaults.bzl", "esbuild", "http_server", "ng_module", "protractor_web_test_suite")
|
||||
load("//tools:defaults2.bzl", "ts_project")
|
||||
|
||||
package(default_visibility = ["//visibility:public"])
|
||||
|
||||
|
|
@ -57,17 +58,21 @@ http_server(
|
|||
],
|
||||
)
|
||||
|
||||
ts_library(
|
||||
ts_project(
|
||||
name = "img_dir_e2e_tests_lib",
|
||||
testonly = True,
|
||||
srcs = ["e2e/browser-logs-util.ts"] + glob([
|
||||
"e2e/**/*.e2e-spec.ts",
|
||||
]),
|
||||
interop_deps = [
|
||||
"//packages/private/testing",
|
||||
],
|
||||
tsconfig = ":e2e/tsconfig-e2e.json",
|
||||
deps = [
|
||||
"//packages/private/testing",
|
||||
"@npm//@types/selenium-webdriver",
|
||||
"@npm//protractor",
|
||||
"//:node_modules/@types/jasminewd2",
|
||||
"//:node_modules/@types/node",
|
||||
"//:node_modules/@types/selenium-webdriver",
|
||||
"//:node_modules/protractor",
|
||||
],
|
||||
)
|
||||
|
||||
|
|
|
|||
|
|
@ -1,6 +1,8 @@
|
|||
{
|
||||
"compilerOptions": {
|
||||
"lib": ["es2015"],
|
||||
"types": ["node", "jasminewd2"]
|
||||
"lib": ["es2022"],
|
||||
"types": ["node", "jasminewd2"],
|
||||
"declaration": true,
|
||||
"sourceMap": true
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,4 +1,5 @@
|
|||
load("//tools:defaults.bzl", "app_bundle", "http_server", "jasmine_node_test", "ng_module", "ts_library")
|
||||
load("//tools:defaults.bzl", "app_bundle", "http_server", "jasmine_node_test", "ng_module")
|
||||
load("//tools:defaults2.bzl", "ts_project")
|
||||
load("//tools/symbol-extractor:index.bzl", "js_expected_symbol_test")
|
||||
|
||||
package(default_visibility = ["//visibility:public"])
|
||||
|
|
@ -27,17 +28,18 @@ app_bundle(
|
|||
],
|
||||
)
|
||||
|
||||
ts_library(
|
||||
ts_project(
|
||||
name = "test_lib",
|
||||
testonly = True,
|
||||
srcs = glob(["*_spec.ts"]),
|
||||
deps = [
|
||||
"//packages:types",
|
||||
interop_deps = [
|
||||
"//packages/compiler",
|
||||
"//packages/core",
|
||||
"//packages/core/testing",
|
||||
"//packages/private/testing",
|
||||
"@npm//@bazel/runfiles",
|
||||
],
|
||||
deps = [
|
||||
"//:node_modules/@bazel/runfiles",
|
||||
],
|
||||
)
|
||||
|
||||
|
|
|
|||
|
|
@ -1,6 +1,7 @@
|
|||
load("//tools:defaults.bzl", "app_bundle", "jasmine_node_test", "ng_module", "ts_library")
|
||||
load("//tools/symbol-extractor:index.bzl", "js_expected_symbol_test")
|
||||
load("@npm//http-server:index.bzl", "http_server")
|
||||
load("//tools:defaults.bzl", "app_bundle", "jasmine_node_test", "ng_module")
|
||||
load("//tools:defaults2.bzl", "ts_project")
|
||||
load("//tools/symbol-extractor:index.bzl", "js_expected_symbol_test")
|
||||
|
||||
package(default_visibility = ["//visibility:public"])
|
||||
|
||||
|
|
@ -24,16 +25,17 @@ app_bundle(
|
|||
],
|
||||
)
|
||||
|
||||
ts_library(
|
||||
ts_project(
|
||||
name = "test_lib",
|
||||
testonly = True,
|
||||
srcs = glob(["*_spec.ts"]),
|
||||
deps = [
|
||||
"//packages:types",
|
||||
interop_deps = [
|
||||
"//packages/compiler",
|
||||
"//packages/core/testing",
|
||||
"//packages/private/testing",
|
||||
"@npm//@bazel/runfiles",
|
||||
],
|
||||
deps = [
|
||||
"//:node_modules/@bazel/runfiles",
|
||||
],
|
||||
)
|
||||
|
||||
|
|
|
|||
|
|
@ -6,11 +6,14 @@
|
|||
* found in the LICENSE file at https://angular.dev/license
|
||||
*/
|
||||
|
||||
import {AsyncPipe} from '@angular/common';
|
||||
import {PLATFORM_BROWSER_ID} from '@angular/common/src/platform_id';
|
||||
import {AsyncPipe, ɵPLATFORM_BROWSER_ID as PLATFORM_BROWSER_ID} from '@angular/common';
|
||||
import {bootstrapApplication} from '@angular/platform-browser';
|
||||
import {BehaviorSubject} from 'rxjs';
|
||||
import {filter, take, tap} from 'rxjs/operators';
|
||||
import {toSignal} from '../rxjs-interop';
|
||||
import {
|
||||
afterNextRender,
|
||||
afterEveryRender,
|
||||
afterNextRender,
|
||||
ApplicationRef,
|
||||
ChangeDetectorRef,
|
||||
Component,
|
||||
|
|
@ -26,33 +29,29 @@ import {
|
|||
NgZone,
|
||||
Output,
|
||||
PLATFORM_ID,
|
||||
provideZonelessChangeDetection as provideZonelessChangeDetection,
|
||||
provideZoneChangeDetection,
|
||||
provideZonelessChangeDetection,
|
||||
signal,
|
||||
TemplateRef,
|
||||
Type,
|
||||
ViewChild,
|
||||
ViewContainerRef,
|
||||
} from '../src/core';
|
||||
import {toSignal} from '../rxjs-interop';
|
||||
import {
|
||||
ComponentFixture,
|
||||
ComponentFixtureAutoDetect,
|
||||
TestBed,
|
||||
fakeAsync,
|
||||
flush,
|
||||
TestBed,
|
||||
tick,
|
||||
} from '../testing';
|
||||
import {bootstrapApplication} from '@angular/platform-browser';
|
||||
import {withBody} from '@angular/private/testing';
|
||||
import {BehaviorSubject, firstValueFrom} from 'rxjs';
|
||||
import {filter, take, tap} from 'rxjs/operators';
|
||||
|
||||
import {provideNoopAnimations} from '@angular/platform-browser/animations';
|
||||
import {isBrowser, isNode, withBody} from '@angular/private/testing';
|
||||
import {ChangeDetectionSchedulerImpl} from '../src/change_detection/scheduling/zoneless_scheduling_impl';
|
||||
import {RuntimeError, RuntimeErrorCode} from '../src/errors';
|
||||
import {scheduleCallbackWithRafRace} from '../src/util/callback_scheduler';
|
||||
import {ChangeDetectionSchedulerImpl} from '../src/change_detection/scheduling/zoneless_scheduling_impl';
|
||||
import {global} from '../src/util/global';
|
||||
import {provideNoopAnimations} from '@angular/platform-browser/animations';
|
||||
|
||||
function isStable(injector = TestBed.inject(EnvironmentInjector)): boolean {
|
||||
return toSignal(injector.get(ApplicationRef).isStable, {requireSync: true, injector})();
|
||||
|
|
|
|||
|
|
@ -1,14 +1,15 @@
|
|||
load("//tools:defaults.bzl", "jasmine_node_test", "karma_web_test_suite", "ts_library")
|
||||
load("//tools:defaults.bzl", "jasmine_node_test", "karma_web_test_suite")
|
||||
load("//tools:defaults2.bzl", "ts_project")
|
||||
|
||||
package(default_visibility = ["//visibility:private"])
|
||||
|
||||
ts_library(
|
||||
ts_project(
|
||||
name = "compiler_lib",
|
||||
testonly = True,
|
||||
srcs = glob(
|
||||
["**/*.ts"],
|
||||
),
|
||||
deps = [
|
||||
interop_deps = [
|
||||
"//packages/core/src/compiler",
|
||||
"//packages/core/src/util",
|
||||
],
|
||||
|
|
|
|||
|
|
@ -27,8 +27,8 @@ import {
|
|||
waitForAsync,
|
||||
withModule,
|
||||
} from '../testing';
|
||||
import {dispatchEvent} from '@angular/platform-browser/testing/src/browser_util';
|
||||
import {expect} from '@angular/platform-browser/testing/src/matchers';
|
||||
import {dispatchEvent} from '@angular/private/testing';
|
||||
import {expect} from '@angular/private/testing/matchers';
|
||||
|
||||
@Component({
|
||||
selector: 'simple-comp',
|
||||
|
|
|
|||
|
|
@ -28,9 +28,9 @@ import {
|
|||
ViewContainerRef,
|
||||
} from '../../src/core';
|
||||
import {ComponentFixture, TestBed, waitForAsync} from '../../testing';
|
||||
import {By} from '@angular/platform-browser/src/dom/debug/by';
|
||||
import {createMouseEvent, hasClass} from '@angular/platform-browser/testing/src/browser_util';
|
||||
import {expect} from '@angular/platform-browser/testing/src/matchers';
|
||||
import {By} from '@angular/platform-browser';
|
||||
import {createMouseEvent, hasClass} from '@angular/private/testing';
|
||||
import {expect} from '@angular/private/testing/matchers';
|
||||
|
||||
@Injectable()
|
||||
class Logger {
|
||||
|
|
|
|||
|
|
@ -10,7 +10,7 @@ import {ɵPLATFORM_BROWSER_ID as PLATFORM_BROWSER_ID} from '@angular/common';
|
|||
import {Component, PLATFORM_ID} from '../src/core';
|
||||
import {PendingTasksInternal} from '../src/pending_tasks';
|
||||
import {DeferBlockBehavior, DeferBlockState, TestBed} from '../testing';
|
||||
import {expect} from '@angular/platform-browser/testing/src/matchers';
|
||||
import {expect} from '@angular/private/testing/matchers';
|
||||
|
||||
@Component({
|
||||
selector: 'second-deferred-comp',
|
||||
|
|
|
|||
|
|
@ -7,7 +7,7 @@
|
|||
*/
|
||||
|
||||
import {ɵgetDOM as getDOM} from '@angular/common';
|
||||
import {isTextNode} from '@angular/platform-browser/testing/src/browser_util';
|
||||
import {isTextNode} from '@angular/private/testing';
|
||||
|
||||
describe('dom adapter', () => {
|
||||
let defaultDoc: any;
|
||||
|
|
|
|||
|
|
@ -8,6 +8,7 @@
|
|||
|
||||
import {TestBed} from '../testing';
|
||||
import {ErrorHandler, provideBrowserGlobalErrorListeners} from '../src/error_handler';
|
||||
import {isNode} from '@angular/private/testing';
|
||||
|
||||
class MockConsole {
|
||||
res: any[][] = [];
|
||||
|
|
|
|||
|
|
@ -19,7 +19,7 @@ import {
|
|||
QueryList,
|
||||
} from '../src/core';
|
||||
import {TestBed} from '../testing';
|
||||
import {expect} from '@angular/platform-browser/testing/src/matchers';
|
||||
import {expect} from '@angular/private/testing/matchers';
|
||||
|
||||
class Frame {
|
||||
name: string = 'frame';
|
||||
|
|
|
|||
|
|
@ -40,9 +40,9 @@ import {
|
|||
ViewContainerRef,
|
||||
} from '../../src/core';
|
||||
import {ComponentFixture, fakeAsync, TestBed} from '../../testing';
|
||||
import {By} from '@angular/platform-browser/src/dom/debug/by';
|
||||
import {isTextNode} from '@angular/platform-browser/testing/src/browser_util';
|
||||
import {expect} from '@angular/platform-browser/testing/src/matchers';
|
||||
import {By} from '@angular/platform-browser';
|
||||
import {isTextNode} from '@angular/private/testing';
|
||||
import {expect} from '@angular/private/testing/matchers';
|
||||
|
||||
import {MockResourceLoader} from './resource_loader_mock';
|
||||
import {NoopAnimationsModule} from '@angular/platform-browser/animations';
|
||||
|
|
|
|||
|
|
@ -51,13 +51,8 @@ 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/platform-browser/testing/src/browser_util';
|
||||
import {expect} from '@angular/platform-browser/testing/src/matchers';
|
||||
import {createMouseEvent, dispatchEvent, el, isCommentNode} from '@angular/private/testing';
|
||||
import {expect} from '@angular/private/testing/matchers';
|
||||
|
||||
import {stringify} from '../../src/util/stringify';
|
||||
|
||||
|
|
|
|||
|
|
@ -20,7 +20,7 @@ import {
|
|||
ViewChildren,
|
||||
} from '../../src/core';
|
||||
import {TestBed} from '../../testing';
|
||||
import {expect} from '@angular/platform-browser/testing/src/matchers';
|
||||
import {expect} from '@angular/private/testing/matchers';
|
||||
|
||||
describe('<ng-container>', function () {
|
||||
beforeEach(() => {
|
||||
|
|
|
|||
|
|
@ -16,8 +16,6 @@ import {
|
|||
EnvironmentInjector,
|
||||
Injector,
|
||||
Input,
|
||||
NgModule,
|
||||
NO_ERRORS_SCHEMA,
|
||||
OnInit,
|
||||
reflectComponentType,
|
||||
TemplateRef,
|
||||
|
|
@ -26,8 +24,9 @@ import {
|
|||
ViewEncapsulation,
|
||||
} from '../../src/core';
|
||||
import {ComponentFixture, TestBed} from '../../testing';
|
||||
import {By} from '@angular/platform-browser/src/dom/debug/by';
|
||||
import {expect} from '@angular/platform-browser/testing/src/matchers';
|
||||
import {By} from '@angular/platform-browser';
|
||||
import {expect} from '@angular/private/testing/matchers';
|
||||
import {isNode} from '@angular/private/testing';
|
||||
|
||||
describe('projection', () => {
|
||||
beforeEach(() => TestBed.configureTestingModule({declarations: [MainComp, OtherComp, Simple]}));
|
||||
|
|
|
|||
|
|
@ -25,7 +25,7 @@ import {
|
|||
ElementRef,
|
||||
} from '../../src/core';
|
||||
import {ComponentFixture, TestBed, waitForAsync} from '../../testing';
|
||||
import {expect} from '@angular/platform-browser/testing/src/matchers';
|
||||
import {expect} from '@angular/private/testing/matchers';
|
||||
import {Subject} from 'rxjs';
|
||||
|
||||
import {stringify} from '../../src/util/stringify';
|
||||
|
|
|
|||
|
|
@ -37,7 +37,7 @@ import {
|
|||
} from '../../src/core';
|
||||
import {fakeAsync, inject, TestBed, tick} from '../../testing';
|
||||
import {BrowserModule, By, platformBrowser} from '@angular/platform-browser';
|
||||
import {expect} from '@angular/platform-browser/testing/src/matchers';
|
||||
import {expect} from '@angular/private/testing/matchers';
|
||||
|
||||
describe('regressions', () => {
|
||||
beforeEach(() => {
|
||||
|
|
|
|||
|
|
@ -8,7 +8,7 @@
|
|||
|
||||
import {Component, Directive, HostBinding, Input, NO_ERRORS_SCHEMA} from '../../src/core';
|
||||
import {ComponentFixture, getTestBed, TestBed} from '../../testing';
|
||||
import {DomSanitizer} from '@angular/platform-browser/src/security/dom_sanitization_service';
|
||||
import {DomSanitizer} from '@angular/platform-browser';
|
||||
|
||||
@Component({
|
||||
selector: 'my-comp',
|
||||
|
|
|
|||
|
|
@ -6,14 +6,17 @@
|
|||
* found in the LICENSE file at https://angular.dev/license
|
||||
*/
|
||||
|
||||
import {ResourceLoader, SourceMap} from '@angular/compiler';
|
||||
import {CompilerFacadeImpl} from '@angular/compiler/src/jit_compiler_facade';
|
||||
import {JitEvaluator} from '@angular/compiler/src/output/output_jit';
|
||||
import {escapeRegExp} from '@angular/compiler/src/util';
|
||||
import {
|
||||
ResourceLoader,
|
||||
SourceMap,
|
||||
JitEvaluator,
|
||||
CompilerFacadeImpl,
|
||||
escapeRegExp,
|
||||
} from '@angular/compiler';
|
||||
import {Attribute, Component, Directive, ErrorHandler} from '../../src/core';
|
||||
import {CompilerFacade, ExportedCompilerFacade} from '../../src/compiler/compiler_facade';
|
||||
import {resolveComponentResources} from '../../src/metadata/resource_loading';
|
||||
import {fakeAsync, TestBed, tick} from '../../testing';
|
||||
import {TestBed} from '../../testing';
|
||||
|
||||
import {MockResourceLoader} from './resource_loader_mock';
|
||||
import {extractSourceMap, originalPositionFor} from './source_map_util';
|
||||
|
|
|
|||
|
|
@ -35,7 +35,7 @@ import {
|
|||
ViewContainerRef,
|
||||
} from '../../src/core';
|
||||
import {ComponentFixture, fakeAsync, TestBed} from '../../testing';
|
||||
import {expect} from '@angular/platform-browser/testing/src/matchers';
|
||||
import {expect} from '@angular/private/testing/matchers';
|
||||
|
||||
@Directive({
|
||||
selector: '[simpleDirective]',
|
||||
|
|
|
|||
|
|
@ -1,8 +1,9 @@
|
|||
load("//tools:defaults.bzl", "jasmine_node_test", "karma_web_test_suite", "ts_library")
|
||||
load("//tools:defaults.bzl", "jasmine_node_test", "karma_web_test_suite")
|
||||
load("//tools:defaults2.bzl", "ts_project")
|
||||
|
||||
package(default_visibility = ["//visibility:public"])
|
||||
|
||||
ts_library(
|
||||
ts_project(
|
||||
name = "render3_lib",
|
||||
testonly = True,
|
||||
srcs = glob(
|
||||
|
|
@ -16,9 +17,8 @@ ts_library(
|
|||
"matchers.ts",
|
||||
],
|
||||
),
|
||||
deps = [
|
||||
interop_deps = [
|
||||
":matchers",
|
||||
"//packages:types",
|
||||
"//packages/animations",
|
||||
"//packages/animations/browser",
|
||||
"//packages/animations/browser/testing",
|
||||
|
|
@ -35,29 +35,31 @@ ts_library(
|
|||
"//packages/platform-browser/animations",
|
||||
"//packages/platform-browser/testing",
|
||||
"//packages/private/testing",
|
||||
"@npm//rxjs",
|
||||
],
|
||||
deps = [
|
||||
"//:node_modules/rxjs",
|
||||
],
|
||||
)
|
||||
|
||||
ts_library(
|
||||
ts_project(
|
||||
name = "matchers",
|
||||
testonly = True,
|
||||
srcs = [
|
||||
"is_shape_of.ts",
|
||||
"matchers.ts",
|
||||
],
|
||||
deps = [
|
||||
interop_deps = [
|
||||
"//packages/core",
|
||||
],
|
||||
)
|
||||
|
||||
ts_library(
|
||||
ts_project(
|
||||
name = "domino",
|
||||
testonly = True,
|
||||
srcs = [
|
||||
"load_domino.ts",
|
||||
],
|
||||
deps = [
|
||||
interop_deps = [
|
||||
"//packages/common",
|
||||
"//packages/compiler",
|
||||
"//packages/platform-server",
|
||||
|
|
@ -66,13 +68,13 @@ ts_library(
|
|||
],
|
||||
)
|
||||
|
||||
ts_library(
|
||||
ts_project(
|
||||
name = "render3_node_lib",
|
||||
testonly = True,
|
||||
srcs = [],
|
||||
deps = [
|
||||
":domino",
|
||||
":render3_lib",
|
||||
":domino_rjs",
|
||||
":render3_lib_rjs",
|
||||
],
|
||||
)
|
||||
|
||||
|
|
|
|||
|
|
@ -6,11 +6,19 @@
|
|||
* found in the LICENSE file at https://angular.dev/license
|
||||
*/
|
||||
|
||||
import {PLATFORM_BROWSER_ID, PLATFORM_SERVER_ID} from '@angular/common/src/platform_id';
|
||||
import {
|
||||
ɵPLATFORM_BROWSER_ID as PLATFORM_BROWSER_ID,
|
||||
ɵPLATFORM_SERVER_ID as PLATFORM_SERVER_ID,
|
||||
} from '@angular/common';
|
||||
import {
|
||||
EventManager,
|
||||
EventManagerPlugin,
|
||||
ɵDomRendererFactory2,
|
||||
ɵSharedStylesHost,
|
||||
} from '@angular/platform-browser';
|
||||
import {isNode} from '@angular/private/testing';
|
||||
import {type ListenerOptions, NgZone, RendererFactory2, RendererType2} from '../../src/core';
|
||||
import {NoopNgZone} from '../../src/zone/ng_zone';
|
||||
import {EventManager, ɵDomRendererFactory2, ɵSharedStylesHost} from '@angular/platform-browser';
|
||||
import {EventManagerPlugin} from '@angular/platform-browser/src/dom/events/event_manager';
|
||||
|
||||
export class SimpleDomEventsPlugin extends EventManagerPlugin {
|
||||
constructor(doc: any) {
|
||||
|
|
|
|||
|
|
@ -1,13 +1,13 @@
|
|||
load("//tools:defaults.bzl", "jasmine_node_test", "ts_library")
|
||||
load("//tools:defaults.bzl", "jasmine_node_test")
|
||||
load("//tools:defaults2.bzl", "ts_project")
|
||||
|
||||
package(default_visibility = ["//visibility:public"])
|
||||
|
||||
ts_library(
|
||||
ts_project(
|
||||
name = "ivy_lib",
|
||||
testonly = True,
|
||||
srcs = glob(["**/*.ts"]),
|
||||
deps = [
|
||||
"//packages:types",
|
||||
interop_deps = [
|
||||
"//packages/core",
|
||||
"//packages/core/src/di/interface",
|
||||
],
|
||||
|
|
|
|||
|
|
@ -6,7 +6,7 @@
|
|||
* found in the LICENSE file at https://angular.dev/license
|
||||
*/
|
||||
|
||||
import {InputFlags} from '@angular/compiler/src/core';
|
||||
import {core} from '@angular/compiler';
|
||||
import {
|
||||
ChangeDetectionStrategy,
|
||||
Component,
|
||||
|
|
@ -70,8 +70,8 @@ describe('component declaration jit compilation', () => {
|
|||
|
||||
expectComponentDef(def, {
|
||||
inputs: {
|
||||
'property': ['minifiedProperty', InputFlags.None, null],
|
||||
'bindingName': ['minifiedClassProperty', InputFlags.None, null],
|
||||
'property': ['minifiedProperty', core.InputFlags.None, null],
|
||||
'bindingName': ['minifiedClassProperty', core.InputFlags.None, null],
|
||||
},
|
||||
declaredInputs: {
|
||||
'property': 'property',
|
||||
|
|
@ -98,7 +98,7 @@ describe('component declaration jit compilation', () => {
|
|||
inputs: {
|
||||
'bindingName': [
|
||||
'minifiedClassProperty',
|
||||
InputFlags.HasDecoratorInputTransform,
|
||||
core.InputFlags.HasDecoratorInputTransform,
|
||||
transformFn,
|
||||
],
|
||||
},
|
||||
|
|
|
|||
|
|
@ -6,8 +6,7 @@
|
|||
* found in the LICENSE file at https://angular.dev/license
|
||||
*/
|
||||
|
||||
import {ExternalReference} from '@angular/compiler';
|
||||
import {Identifiers} from '@angular/compiler/src/render3/r3_identifiers';
|
||||
import {ExternalReference, R3Identifiers} from '@angular/compiler';
|
||||
|
||||
import {angularCoreEnv} from '../../src/render3/jit/environment';
|
||||
|
||||
|
|
@ -63,7 +62,7 @@ describe('r3 jit environment', () => {
|
|||
it('should support all r3 symbols', () => {
|
||||
Object
|
||||
// Map over the static properties of Identifiers.
|
||||
.values(Identifiers)
|
||||
.values(R3Identifiers)
|
||||
// A few such properties are string constants. Ignore them, and focus on ExternalReferences.
|
||||
.filter(isExternalReference)
|
||||
// Some references are to interface types. Only take properties which have runtime values.
|
||||
|
|
|
|||
|
|
@ -10,7 +10,7 @@
|
|||
import '@angular/compiler'; // For JIT mode. Must be in front of any other @angular/* imports.
|
||||
|
||||
import {ɵgetDOM as getDOM} from '@angular/common';
|
||||
import {DominoAdapter} from '@angular/platform-server/src/domino_adapter';
|
||||
import {ɵDominoAdapter as DominoAdapter} from '@angular/platform-server';
|
||||
|
||||
if (typeof window == 'undefined') {
|
||||
const domino = require('../../../platform-server/src/bundled-domino');
|
||||
|
|
|
|||
|
|
@ -6,6 +6,9 @@
|
|||
* found in the LICENSE file at https://angular.dev/license
|
||||
*/
|
||||
|
||||
// Needed for the global `Zone` ambient types to be available.
|
||||
import type {} from 'zone.js';
|
||||
|
||||
import {AsyncPipe} from '@angular/common';
|
||||
import {
|
||||
AfterViewInit,
|
||||
|
|
|
|||
|
|
@ -7,7 +7,7 @@
|
|||
*/
|
||||
|
||||
import {Sanitizer, Type} from '../../src/core';
|
||||
import {stringifyElement} from '@angular/platform-browser/testing/src/browser_util';
|
||||
import {stringifyElement} from '@angular/private/testing';
|
||||
|
||||
import {extractDirectiveDef} from '../../src/render3/definition';
|
||||
import {refreshView} from '../../src/render3/instructions/change_detection';
|
||||
|
|
|
|||
|
|
@ -8,6 +8,7 @@
|
|||
|
||||
import {_sanitizeHtml} from '../../src/sanitization/html_sanitizer';
|
||||
import {isDOMParserAvailable} from '../../src/sanitization/inert_body';
|
||||
import {isBrowser} from '@angular/private/testing';
|
||||
|
||||
function sanitizeHtml(defaultDoc: any, unsafeHtmlInput: string): string {
|
||||
return _sanitizeHtml(defaultDoc, unsafeHtmlInput).toString();
|
||||
|
|
|
|||
|
|
@ -6,7 +6,7 @@
|
|||
* found in the LICENSE file at https://angular.dev/license
|
||||
*/
|
||||
|
||||
import {SECURITY_SCHEMA} from '@angular/compiler/src/schema/dom_security_schema';
|
||||
import {SECURITY_SCHEMA} from '@angular/compiler';
|
||||
import {ENVIRONMENT, LView} from '../../src/render3/interfaces/view';
|
||||
import {enterView, leaveView} from '../../src/render3/state';
|
||||
|
||||
|
|
|
|||
|
|
@ -1,14 +1,15 @@
|
|||
load("//tools:defaults.bzl", "jasmine_node_test", "karma_web_test_suite", "ts_library")
|
||||
load("//tools:defaults.bzl", "jasmine_node_test", "karma_web_test_suite")
|
||||
load("//tools:defaults2.bzl", "ts_project")
|
||||
|
||||
package(default_visibility = ["//visibility:private"])
|
||||
|
||||
ts_library(
|
||||
ts_project(
|
||||
name = "signals_lib",
|
||||
testonly = True,
|
||||
srcs = glob(
|
||||
["**/*.ts"],
|
||||
),
|
||||
deps = [
|
||||
interop_deps = [
|
||||
"//packages/core",
|
||||
"//packages/core/primitives/signals",
|
||||
"//packages/core/src/util",
|
||||
|
|
|
|||
|
|
@ -1,6 +1,7 @@
|
|||
package(default_visibility = ["//visibility:private"])
|
||||
load("//tools:defaults.bzl", "jasmine_node_test", "ts_config")
|
||||
load("//tools:defaults2.bzl", "ts_project")
|
||||
|
||||
load("//tools:defaults.bzl", "jasmine_node_test", "ts_config", "ts_library")
|
||||
package(default_visibility = ["//visibility:private"])
|
||||
|
||||
ts_config(
|
||||
name = "tsconfig",
|
||||
|
|
@ -10,15 +11,16 @@ ts_config(
|
|||
],
|
||||
)
|
||||
|
||||
ts_library(
|
||||
ts_project(
|
||||
name = "strict_types_lib",
|
||||
testonly = True,
|
||||
srcs = glob(
|
||||
["**/*.ts"],
|
||||
),
|
||||
extends = "//packages:tsconfig_test",
|
||||
tsconfig = ":tsconfig",
|
||||
deps = [
|
||||
"//packages/core",
|
||||
"//packages/core:core_rjs",
|
||||
],
|
||||
)
|
||||
|
||||
|
|
|
|||
|
|
@ -6,7 +6,7 @@
|
|||
* found in the LICENSE file at https://angular.dev/license
|
||||
*/
|
||||
|
||||
import {PLATFORM_BROWSER_ID} from '@angular/common/src/platform_id';
|
||||
import {ɵPLATFORM_BROWSER_ID} from '@angular/common';
|
||||
import {
|
||||
APP_INITIALIZER,
|
||||
ChangeDetectorRef,
|
||||
|
|
@ -44,7 +44,7 @@ import {
|
|||
import {DeferBlockBehavior} from '../testing';
|
||||
import {TestBed, TestBedImpl} from '../testing/src/test_bed';
|
||||
import {By} from '@angular/platform-browser';
|
||||
import {expect} from '@angular/platform-browser/testing/src/matchers';
|
||||
import {expect} from '@angular/private/testing/matchers';
|
||||
|
||||
import {NgModuleType} from '../src/render3';
|
||||
import {depsTracker} from '../src/render3/deps_tracker/deps_tracker';
|
||||
|
|
@ -1753,7 +1753,7 @@ describe('TestBed', () => {
|
|||
|
||||
// Set `PLATFORM_ID` to a browser platform value to trigger defer loading
|
||||
// while running tests in Node.
|
||||
const COMMON_PROVIDERS = [{provide: PLATFORM_ID, useValue: PLATFORM_BROWSER_ID}];
|
||||
const COMMON_PROVIDERS = [{provide: PLATFORM_ID, useValue: ɵPLATFORM_BROWSER_ID}];
|
||||
|
||||
TestBed.configureTestingModule({imports: [ParentCmp], providers: [COMMON_PROVIDERS]});
|
||||
TestBed.overrideProvider(ImportantService, {useValue: {value: 'overridden'}});
|
||||
|
|
|
|||
|
|
@ -6,6 +6,9 @@
|
|||
* found in the LICENSE file at https://angular.dev/license
|
||||
*/
|
||||
|
||||
// Needed for the global `Zone` ambient types to be available.
|
||||
import type {} from 'zone.js';
|
||||
|
||||
import {firstValueFrom} from 'rxjs';
|
||||
import {Component, EventEmitter, NgZone, provideZoneChangeDetection} from '../../src/core';
|
||||
import {TestBed, fakeAsync, flush, flushMicrotasks, inject, waitForAsync} from '../../testing';
|
||||
|
|
@ -14,6 +17,7 @@ import {Log} from '../../testing/src/testing_internal';
|
|||
import {scheduleCallbackWithRafRace as scheduler} from '../../src/util/callback_scheduler';
|
||||
import {global} from '../../src/util/global';
|
||||
import {NoopNgZone} from '../../src/zone/ng_zone';
|
||||
import {isBrowser} from '@angular/private/testing';
|
||||
|
||||
const resultTimer = 1000;
|
||||
// Schedules a macrotask (using a timer)
|
||||
|
|
|
|||
Loading…
Reference in a new issue