From 3613e7c4e546f85dc8b0a88f66bcf619248fdd51 Mon Sep 17 00:00:00 2001 From: Alex Rickabaugh Date: Wed, 4 Nov 2020 12:27:19 -0800 Subject: [PATCH] test(compiler-cli): move testing utils to separate package (#39594) ngtsc has a robust suite of testing utilities, designed for in-memory testing of a TypeScript compiler. Previously these utilities lived in the `test` directory for the compiler-cli package. This commit moves those utilities to an `ngtsc/testing` package, enabling them to be depended on separately and opening the door for using them from the upcoming language server testing infrastructure. As part of this refactoring, the `fake_core` package (a lightweight API replacement for @angular/core) is expanded to include functionality needed for Language Service test use cases. PR Close #39594 --- goldens/circular-deps/packages.json | 4 ---- packages/compiler-cli/ngcc/test/BUILD.bazel | 4 +--- .../test/analysis/decoration_analyzer_spec.ts | 2 +- .../ngcc/test/analysis/migration_host_spec.ts | 3 +-- .../module_with_providers_analyzer_spec.ts | 3 +-- .../test/analysis/ngcc_trait_compiler_spec.ts | 3 +-- .../private_declarations_analyzer_spec.ts | 3 +-- .../test/analysis/references_registry_spec.ts | 3 +-- .../analysis/switch_marker_analyzer_spec.ts | 2 +- .../commonjs_dependency_host_spec.ts | 2 +- .../dependencies/dts_dependency_host_spec.ts | 2 +- .../dependencies/esm_dependency_host_spec.ts | 2 +- .../test/dependencies/module_resolver_spec.ts | 2 +- .../dependencies/umd_dependency_host_spec.ts | 2 +- ...directory_walker_entry_point_finder_spec.ts | 2 +- .../program_based_entry_point_finder_spec.ts | 3 +-- .../targeted_entry_point_finder_spec.ts | 2 +- .../host/commonjs_host_import_helper_spec.ts | 3 +-- .../ngcc/test/host/commonjs_host_spec.ts | 3 +-- .../host/esm2015_host_import_helper_spec.ts | 3 +-- .../ngcc/test/host/esm2015_host_spec.ts | 4 +--- .../test/host/esm5_host_import_helper_spec.ts | 3 +-- .../ngcc/test/host/esm5_host_spec.ts | 3 +-- .../test/host/umd_host_import_helper_spec.ts | 3 +-- .../ngcc/test/host/umd_host_spec.ts | 3 +-- .../ngcc/test/integration/ngcc_spec.ts | 2 +- .../compiler-cli/ngcc/test/integration/util.ts | 2 +- .../missing_injectable_migration_spec.ts | 2 +- .../undecorated_parent_migration_spec.ts | 2 +- .../ngcc/test/packages/build_marker_spec.ts | 2 +- .../ngcc/test/packages/configuration_spec.ts | 2 +- .../test/packages/entry_point_bundle_spec.ts | 2 +- .../test/packages/entry_point_manifest_spec.ts | 2 +- .../ngcc/test/packages/entry_point_spec.ts | 2 +- .../test/packages/source_file_cache_spec.ts | 2 +- .../commonjs_rendering_formatter_spec.ts | 3 +-- .../ngcc/test/rendering/dts_renderer_spec.ts | 2 +- .../rendering/esm5_rendering_formatter_spec.ts | 3 +-- .../rendering/esm_rendering_formatter_spec.ts | 2 +- .../ngcc/test/rendering/renderer_spec.ts | 2 +- .../rendering/umd_rendering_formatter_spec.ts | 3 +-- .../test/writing/in_place_file_writer_spec.ts | 2 +- .../new_entry_point_file_writer_spec.ts | 2 +- .../test/writing/package_json_updater_spec.ts | 2 +- .../compiler-cli/src/ngtsc/testing/BUILD.bazel | 2 ++ .../ngtsc/testing}/fake_core/BUILD.bazel | 0 .../ngtsc/testing}/fake_core/README.md | 0 .../ngtsc/testing}/fake_core/index.ts | 7 +++++-- .../ngtsc/testing}/fake_core/package.json | 0 .../compiler-cli/src/ngtsc/testing/index.ts | 5 ++++- .../ngtsc/testing}/src/cached_source_files.ts | 2 +- .../ngtsc/testing}/src/mock_file_loading.ts | 10 ++++++---- .../ngtsc/testing}/src/runfile_helpers.ts | 0 packages/compiler-cli/test/BUILD.bazel | 2 +- .../test/compliance/full/BUILD.bazel | 2 +- .../test/compliance/linked/BUILD.bazel | 2 +- .../partial/partial_compliance_goldens.bzl | 4 ++-- .../test/compliance/test_helpers/BUILD.bazel | 2 +- .../compliance/test_helpers/compile_test.ts | 2 +- .../test/compliance_old/BUILD.bazel | 2 +- .../test/compliance_old/prelink/BUILD.bazel | 2 +- packages/compiler-cli/test/helpers/BUILD.bazel | 18 ------------------ packages/compiler-cli/test/helpers/index.ts | 10 ---------- packages/compiler-cli/test/ngtsc/BUILD.bazel | 3 +-- packages/compiler-cli/test/ngtsc/env.ts | 2 +- .../test/ngtsc/incremental_error_spec.ts | 2 +- .../test/ngtsc/incremental_spec.ts | 2 +- .../test/ngtsc/modulewithproviders_spec.ts | 2 +- .../compiler-cli/test/ngtsc/monorepo_spec.ts | 2 +- packages/compiler-cli/test/ngtsc/ngtsc_spec.ts | 2 +- packages/compiler-cli/test/ngtsc/scope_spec.ts | 2 +- .../test/ngtsc/template_mapping_spec.ts | 2 +- .../test/ngtsc/template_typecheck_spec.ts | 3 +-- packages/compiler-cli/test/test_support.ts | 2 +- packages/compiler/test/BUILD.bazel | 2 +- packages/compiler/test/aot/test_util.ts | 4 ++-- .../tools/test/extract/integration/BUILD.bazel | 2 +- .../test/extract/integration/main_spec.ts | 2 +- .../test/translate/integration/BUILD.bazel | 2 +- .../test/translate/integration/main_spec.ts | 2 +- 80 files changed, 88 insertions(+), 132 deletions(-) rename packages/compiler-cli/{test/ngtsc => src/ngtsc/testing}/fake_core/BUILD.bazel (100%) rename packages/compiler-cli/{test/ngtsc => src/ngtsc/testing}/fake_core/README.md (100%) rename packages/compiler-cli/{test/ngtsc => src/ngtsc/testing}/fake_core/index.ts (94%) rename packages/compiler-cli/{test/ngtsc => src/ngtsc/testing}/fake_core/package.json (100%) rename packages/compiler-cli/{test/helpers => src/ngtsc/testing}/src/cached_source_files.ts (96%) rename packages/compiler-cli/{test/helpers => src/ngtsc/testing}/src/mock_file_loading.ts (92%) rename packages/compiler-cli/{test/helpers => src/ngtsc/testing}/src/runfile_helpers.ts (100%) delete mode 100644 packages/compiler-cli/test/helpers/BUILD.bazel delete mode 100644 packages/compiler-cli/test/helpers/index.ts diff --git a/goldens/circular-deps/packages.json b/goldens/circular-deps/packages.json index 1b5b773a2c..b071473cd9 100644 --- a/goldens/circular-deps/packages.json +++ b/goldens/circular-deps/packages.json @@ -41,10 +41,6 @@ "packages/compiler-cli/src/ngtsc/scope/src/component_scope.ts", "packages/compiler-cli/src/ngtsc/scope/src/local.ts" ], - [ - "packages/compiler-cli/test/helpers/index.ts", - "packages/compiler-cli/test/helpers/src/mock_file_loading.ts" - ], [ "packages/compiler/src/compile_metadata.ts", "packages/compiler/src/lifecycle_reflector.ts", diff --git a/packages/compiler-cli/ngcc/test/BUILD.bazel b/packages/compiler-cli/ngcc/test/BUILD.bazel index 6b789eaf86..c337e11621 100644 --- a/packages/compiler-cli/ngcc/test/BUILD.bazel +++ b/packages/compiler-cli/ngcc/test/BUILD.bazel @@ -25,7 +25,6 @@ ts_library( "//packages/compiler-cli/src/ngtsc/testing", "//packages/compiler-cli/src/ngtsc/transform", "//packages/compiler-cli/src/ngtsc/translator", - "//packages/compiler-cli/test/helpers", "@npm//@types/convert-source-map", "@npm//convert-source-map", "@npm//dependency-graph", @@ -40,7 +39,7 @@ jasmine_node_test( name = "test", bootstrap = ["//tools/testing:node_no_angular_es5"], data = [ - "//packages/compiler-cli/test/ngtsc/fake_core:npm_package", + "//packages/compiler-cli/src/ngtsc/testing/fake_core:npm_package", ], deps = [ ":test_lib", @@ -60,7 +59,6 @@ ts_library( "//packages/compiler-cli/src/ngtsc/file_system/testing", "//packages/compiler-cli/src/ngtsc/logging/testing", "//packages/compiler-cli/src/ngtsc/testing", - "//packages/compiler-cli/test/helpers", "@npm//rxjs", "@npm//typescript", ], diff --git a/packages/compiler-cli/ngcc/test/analysis/decoration_analyzer_spec.ts b/packages/compiler-cli/ngcc/test/analysis/decoration_analyzer_spec.ts index 6324909414..42e10f387f 100644 --- a/packages/compiler-cli/ngcc/test/analysis/decoration_analyzer_spec.ts +++ b/packages/compiler-cli/ngcc/test/analysis/decoration_analyzer_spec.ts @@ -12,8 +12,8 @@ import {absoluteFrom, getFileSystem, getSourceFileOrError} from '../../../src/ng import {runInEachFileSystem, TestFile} from '../../../src/ngtsc/file_system/testing'; import {MockLogger} from '../../../src/ngtsc/logging/testing'; import {ClassDeclaration, DeclarationNode, Decorator} from '../../../src/ngtsc/reflection'; +import {loadFakeCore, loadTestFiles} from '../../../src/ngtsc/testing'; import {AnalysisOutput, CompileResult, DecoratorHandler, DetectResult, HandlerPrecedence} from '../../../src/ngtsc/transform'; -import {loadFakeCore, loadTestFiles} from '../../../test/helpers'; import {DecorationAnalyzer} from '../../src/analysis/decoration_analyzer'; import {NgccReferencesRegistry} from '../../src/analysis/ngcc_references_registry'; import {CompiledClass, DecorationAnalyses} from '../../src/analysis/types'; diff --git a/packages/compiler-cli/ngcc/test/analysis/migration_host_spec.ts b/packages/compiler-cli/ngcc/test/analysis/migration_host_spec.ts index b4053aca97..8bc7203e11 100644 --- a/packages/compiler-cli/ngcc/test/analysis/migration_host_spec.ts +++ b/packages/compiler-cli/ngcc/test/analysis/migration_host_spec.ts @@ -13,9 +13,8 @@ import {absoluteFrom} from '../../../src/ngtsc/file_system'; import {runInEachFileSystem} from '../../../src/ngtsc/file_system/testing'; import {MockLogger} from '../../../src/ngtsc/logging/testing'; import {ClassDeclaration, Decorator, isNamedClassDeclaration} from '../../../src/ngtsc/reflection'; -import {getDeclaration} from '../../../src/ngtsc/testing'; +import {getDeclaration, loadTestFiles} from '../../../src/ngtsc/testing'; import {AnalysisOutput, CompileResult, DecoratorHandler, DetectResult, HandlerPrecedence, TraitState} from '../../../src/ngtsc/transform'; -import {loadTestFiles} from '../../../test/helpers'; import {DefaultMigrationHost} from '../../src/analysis/migration_host'; import {NgccTraitCompiler} from '../../src/analysis/ngcc_trait_compiler'; import {Esm2015ReflectionHost} from '../../src/host/esm2015_host'; diff --git a/packages/compiler-cli/ngcc/test/analysis/module_with_providers_analyzer_spec.ts b/packages/compiler-cli/ngcc/test/analysis/module_with_providers_analyzer_spec.ts index c3735c4184..f0012a5757 100644 --- a/packages/compiler-cli/ngcc/test/analysis/module_with_providers_analyzer_spec.ts +++ b/packages/compiler-cli/ngcc/test/analysis/module_with_providers_analyzer_spec.ts @@ -11,8 +11,7 @@ import {absoluteFrom, AbsoluteFsPath, getSourceFileOrError} from '../../../src/n import {runInEachFileSystem, TestFile} from '../../../src/ngtsc/file_system/testing'; import {MockLogger} from '../../../src/ngtsc/logging/testing'; import {DeclarationNode} from '../../../src/ngtsc/reflection'; -import {getDeclaration, isNamedDeclaration} from '../../../src/ngtsc/testing'; -import {loadTestFiles} from '../../../test/helpers'; +import {getDeclaration, isNamedDeclaration, loadTestFiles} from '../../../src/ngtsc/testing'; import {ModuleWithProvidersAnalyses, ModuleWithProvidersAnalyzer} from '../../src/analysis/module_with_providers_analyzer'; import {NgccReferencesRegistry} from '../../src/analysis/ngcc_references_registry'; import {Esm2015ReflectionHost} from '../../src/host/esm2015_host'; diff --git a/packages/compiler-cli/ngcc/test/analysis/ngcc_trait_compiler_spec.ts b/packages/compiler-cli/ngcc/test/analysis/ngcc_trait_compiler_spec.ts index ab09980e3a..e48d2f2f33 100644 --- a/packages/compiler-cli/ngcc/test/analysis/ngcc_trait_compiler_spec.ts +++ b/packages/compiler-cli/ngcc/test/analysis/ngcc_trait_compiler_spec.ts @@ -11,9 +11,8 @@ import {absoluteFrom} from '../../../src/ngtsc/file_system'; import {runInEachFileSystem} from '../../../src/ngtsc/file_system/testing'; import {MockLogger} from '../../../src/ngtsc/logging/testing'; import {ClassDeclaration, Decorator, isNamedClassDeclaration} from '../../../src/ngtsc/reflection'; -import {getDeclaration} from '../../../src/ngtsc/testing'; +import {getDeclaration, loadTestFiles} from '../../../src/ngtsc/testing'; import {AnalysisOutput, CompileResult, DecoratorHandler, DetectResult, HandlerPrecedence, TraitState} from '../../../src/ngtsc/transform'; -import {loadTestFiles} from '../../../test/helpers'; import {NgccTraitCompiler} from '../../src/analysis/ngcc_trait_compiler'; import {Esm2015ReflectionHost} from '../../src/host/esm2015_host'; import {createComponentDecorator} from '../../src/migrations/utils'; diff --git a/packages/compiler-cli/ngcc/test/analysis/private_declarations_analyzer_spec.ts b/packages/compiler-cli/ngcc/test/analysis/private_declarations_analyzer_spec.ts index de4acb6483..e07b05ea19 100644 --- a/packages/compiler-cli/ngcc/test/analysis/private_declarations_analyzer_spec.ts +++ b/packages/compiler-cli/ngcc/test/analysis/private_declarations_analyzer_spec.ts @@ -11,8 +11,7 @@ import {absoluteFrom, AbsoluteFsPath} from '../../../src/ngtsc/file_system'; import {runInEachFileSystem, TestFile} from '../../../src/ngtsc/file_system/testing'; import {Reference} from '../../../src/ngtsc/imports'; import {MockLogger} from '../../../src/ngtsc/logging/testing'; -import {getDeclaration} from '../../../src/ngtsc/testing'; -import {loadTestFiles} from '../../../test/helpers/src/mock_file_loading'; +import {getDeclaration, loadTestFiles} from '../../../src/ngtsc/testing'; import {NgccReferencesRegistry} from '../../src/analysis/ngcc_references_registry'; import {PrivateDeclarationsAnalyzer} from '../../src/analysis/private_declarations_analyzer'; import {Esm2015ReflectionHost} from '../../src/host/esm2015_host'; diff --git a/packages/compiler-cli/ngcc/test/analysis/references_registry_spec.ts b/packages/compiler-cli/ngcc/test/analysis/references_registry_spec.ts index dbd10a0177..d4f43ec98b 100644 --- a/packages/compiler-cli/ngcc/test/analysis/references_registry_spec.ts +++ b/packages/compiler-cli/ngcc/test/analysis/references_registry_spec.ts @@ -12,8 +12,7 @@ import {runInEachFileSystem, TestFile} from '../../../src/ngtsc/file_system/test import {Reference} from '../../../src/ngtsc/imports'; import {PartialEvaluator} from '../../../src/ngtsc/partial_evaluator'; import {DeclarationNode, TypeScriptReflectionHost} from '../../../src/ngtsc/reflection'; -import {getDeclaration} from '../../../src/ngtsc/testing'; -import {loadTestFiles} from '../../../test/helpers'; +import {getDeclaration, loadTestFiles} from '../../../src/ngtsc/testing'; import {NgccReferencesRegistry} from '../../src/analysis/ngcc_references_registry'; import {makeTestBundleProgram} from '../helpers/utils'; diff --git a/packages/compiler-cli/ngcc/test/analysis/switch_marker_analyzer_spec.ts b/packages/compiler-cli/ngcc/test/analysis/switch_marker_analyzer_spec.ts index d0dfc62b9a..b64d4bacdc 100644 --- a/packages/compiler-cli/ngcc/test/analysis/switch_marker_analyzer_spec.ts +++ b/packages/compiler-cli/ngcc/test/analysis/switch_marker_analyzer_spec.ts @@ -8,7 +8,7 @@ import {absoluteFrom, getSourceFileOrError} from '../../../src/ngtsc/file_system'; import {runInEachFileSystem, TestFile} from '../../../src/ngtsc/file_system/testing'; import {MockLogger} from '../../../src/ngtsc/logging/testing'; -import {loadTestFiles} from '../../../test/helpers'; +import {loadTestFiles} from '../../../src/ngtsc/testing'; import {SwitchMarkerAnalyzer} from '../../src/analysis/switch_marker_analyzer'; import {Esm2015ReflectionHost} from '../../src/host/esm2015_host'; import {makeTestEntryPointBundle} from '../helpers/utils'; diff --git a/packages/compiler-cli/ngcc/test/dependencies/commonjs_dependency_host_spec.ts b/packages/compiler-cli/ngcc/test/dependencies/commonjs_dependency_host_spec.ts index 51ef70995d..d3a84cea3f 100644 --- a/packages/compiler-cli/ngcc/test/dependencies/commonjs_dependency_host_spec.ts +++ b/packages/compiler-cli/ngcc/test/dependencies/commonjs_dependency_host_spec.ts @@ -8,7 +8,7 @@ import * as ts from 'typescript'; import {absoluteFrom, getFileSystem, relativeFrom} from '../../../src/ngtsc/file_system'; import {runInEachFileSystem} from '../../../src/ngtsc/file_system/testing'; -import {loadTestFiles} from '../../../test/helpers'; +import {loadTestFiles} from '../../../src/ngtsc/testing'; import {CommonJsDependencyHost} from '../../src/dependencies/commonjs_dependency_host'; import {createDependencyInfo} from '../../src/dependencies/dependency_host'; import {ModuleResolver} from '../../src/dependencies/module_resolver'; diff --git a/packages/compiler-cli/ngcc/test/dependencies/dts_dependency_host_spec.ts b/packages/compiler-cli/ngcc/test/dependencies/dts_dependency_host_spec.ts index 291ae50e92..3a18f368ad 100644 --- a/packages/compiler-cli/ngcc/test/dependencies/dts_dependency_host_spec.ts +++ b/packages/compiler-cli/ngcc/test/dependencies/dts_dependency_host_spec.ts @@ -9,7 +9,7 @@ import * as ts from 'typescript'; import {absoluteFrom, getFileSystem, relativeFrom} from '../../../src/ngtsc/file_system'; import {runInEachFileSystem} from '../../../src/ngtsc/file_system/testing'; -import {loadTestFiles} from '../../../test/helpers'; +import {loadTestFiles} from '../../../src/ngtsc/testing'; import {createDependencyInfo} from '../../src/dependencies/dependency_host'; import {DtsDependencyHost} from '../../src/dependencies/dts_dependency_host'; diff --git a/packages/compiler-cli/ngcc/test/dependencies/esm_dependency_host_spec.ts b/packages/compiler-cli/ngcc/test/dependencies/esm_dependency_host_spec.ts index f9e80c2b4d..a0a5ed5586 100644 --- a/packages/compiler-cli/ngcc/test/dependencies/esm_dependency_host_spec.ts +++ b/packages/compiler-cli/ngcc/test/dependencies/esm_dependency_host_spec.ts @@ -9,7 +9,7 @@ import * as ts from 'typescript'; import {absoluteFrom, getFileSystem, relativeFrom} from '../../../src/ngtsc/file_system'; import {runInEachFileSystem} from '../../../src/ngtsc/file_system/testing'; -import {loadTestFiles} from '../../../test/helpers'; +import {loadTestFiles} from '../../../src/ngtsc/testing'; import {createDependencyInfo} from '../../src/dependencies/dependency_host'; import {DtsDependencyHost} from '../../src/dependencies/dts_dependency_host'; import {EsmDependencyHost, hasImportOrReexportStatements, isStringImportOrReexport} from '../../src/dependencies/esm_dependency_host'; diff --git a/packages/compiler-cli/ngcc/test/dependencies/module_resolver_spec.ts b/packages/compiler-cli/ngcc/test/dependencies/module_resolver_spec.ts index a41b16efb4..c308949d2d 100644 --- a/packages/compiler-cli/ngcc/test/dependencies/module_resolver_spec.ts +++ b/packages/compiler-cli/ngcc/test/dependencies/module_resolver_spec.ts @@ -7,7 +7,7 @@ */ import {absoluteFrom, getFileSystem} from '../../../src/ngtsc/file_system'; import {runInEachFileSystem} from '../../../src/ngtsc/file_system/testing'; -import {loadTestFiles} from '../../../test/helpers'; +import {loadTestFiles} from '../../../src/ngtsc/testing'; import {ModuleResolver, ResolvedDeepImport, ResolvedExternalModule, ResolvedRelativeModule} from '../../src/dependencies/module_resolver'; runInEachFileSystem(() => { diff --git a/packages/compiler-cli/ngcc/test/dependencies/umd_dependency_host_spec.ts b/packages/compiler-cli/ngcc/test/dependencies/umd_dependency_host_spec.ts index 77a80abc9a..85f22859fe 100644 --- a/packages/compiler-cli/ngcc/test/dependencies/umd_dependency_host_spec.ts +++ b/packages/compiler-cli/ngcc/test/dependencies/umd_dependency_host_spec.ts @@ -9,7 +9,7 @@ import * as ts from 'typescript'; import {absoluteFrom, getFileSystem, relativeFrom} from '../../../src/ngtsc/file_system'; import {runInEachFileSystem} from '../../../src/ngtsc/file_system/testing'; -import {loadTestFiles} from '../../../test/helpers'; +import {loadTestFiles} from '../../../src/ngtsc/testing'; import {createDependencyInfo} from '../../src/dependencies/dependency_host'; import {ModuleResolver} from '../../src/dependencies/module_resolver'; import {UmdDependencyHost} from '../../src/dependencies/umd_dependency_host'; diff --git a/packages/compiler-cli/ngcc/test/entry_point_finder/directory_walker_entry_point_finder_spec.ts b/packages/compiler-cli/ngcc/test/entry_point_finder/directory_walker_entry_point_finder_spec.ts index a3ecc66be6..2ec0a1b7b7 100644 --- a/packages/compiler-cli/ngcc/test/entry_point_finder/directory_walker_entry_point_finder_spec.ts +++ b/packages/compiler-cli/ngcc/test/entry_point_finder/directory_walker_entry_point_finder_spec.ts @@ -8,7 +8,7 @@ import {absoluteFrom, AbsoluteFsPath, FileSystem, getFileSystem, relative} from '../../../src/ngtsc/file_system'; import {runInEachFileSystem, TestFile} from '../../../src/ngtsc/file_system/testing'; import {MockLogger} from '../../../src/ngtsc/logging/testing'; -import {loadTestFiles} from '../../../test/helpers'; +import {loadTestFiles} from '../../../src/ngtsc/testing'; import {DependencyResolver} from '../../src/dependencies/dependency_resolver'; import {DtsDependencyHost} from '../../src/dependencies/dts_dependency_host'; import {EsmDependencyHost} from '../../src/dependencies/esm_dependency_host'; diff --git a/packages/compiler-cli/ngcc/test/entry_point_finder/program_based_entry_point_finder_spec.ts b/packages/compiler-cli/ngcc/test/entry_point_finder/program_based_entry_point_finder_spec.ts index af847efcb9..5f2eccc366 100644 --- a/packages/compiler-cli/ngcc/test/entry_point_finder/program_based_entry_point_finder_spec.ts +++ b/packages/compiler-cli/ngcc/test/entry_point_finder/program_based_entry_point_finder_spec.ts @@ -8,9 +8,8 @@ import {absoluteFrom, AbsoluteFsPath, FileSystem, getFileSystem, relative} from '../../../src/ngtsc/file_system'; import {runInEachFileSystem, TestFile} from '../../../src/ngtsc/file_system/testing'; import {MockLogger} from '../../../src/ngtsc/logging/testing'; +import {loadTestFiles} from '../../../src/ngtsc/testing'; import {readConfiguration} from '../../../src/perform_compile'; -import {loadTestFiles} from '../../../test/helpers'; - import {DependencyResolver} from '../../src/dependencies/dependency_resolver'; import {DtsDependencyHost} from '../../src/dependencies/dts_dependency_host'; import {EsmDependencyHost} from '../../src/dependencies/esm_dependency_host'; diff --git a/packages/compiler-cli/ngcc/test/entry_point_finder/targeted_entry_point_finder_spec.ts b/packages/compiler-cli/ngcc/test/entry_point_finder/targeted_entry_point_finder_spec.ts index 197b59b21b..e2fce59297 100644 --- a/packages/compiler-cli/ngcc/test/entry_point_finder/targeted_entry_point_finder_spec.ts +++ b/packages/compiler-cli/ngcc/test/entry_point_finder/targeted_entry_point_finder_spec.ts @@ -8,7 +8,7 @@ import {absoluteFrom, AbsoluteFsPath, FileSystem, getFileSystem, relative} from '../../../src/ngtsc/file_system'; import {runInEachFileSystem, TestFile} from '../../../src/ngtsc/file_system/testing'; import {MockLogger} from '../../../src/ngtsc/logging/testing'; -import {loadTestFiles} from '../../../test/helpers'; +import {loadTestFiles} from '../../../src/ngtsc/testing'; import {DependencyResolver} from '../../src/dependencies/dependency_resolver'; import {DtsDependencyHost} from '../../src/dependencies/dts_dependency_host'; import {EsmDependencyHost} from '../../src/dependencies/esm_dependency_host'; diff --git a/packages/compiler-cli/ngcc/test/host/commonjs_host_import_helper_spec.ts b/packages/compiler-cli/ngcc/test/host/commonjs_host_import_helper_spec.ts index c17dfadde3..1d8881fc03 100644 --- a/packages/compiler-cli/ngcc/test/host/commonjs_host_import_helper_spec.ts +++ b/packages/compiler-cli/ngcc/test/host/commonjs_host_import_helper_spec.ts @@ -9,8 +9,7 @@ import {absoluteFrom, getFileSystem} from '../../../src/ngtsc/file_system'; import {runInEachFileSystem, TestFile} from '../../../src/ngtsc/file_system/testing'; import {MockLogger} from '../../../src/ngtsc/logging/testing'; import {isNamedVariableDeclaration} from '../../../src/ngtsc/reflection'; -import {getDeclaration} from '../../../src/ngtsc/testing'; -import {loadFakeCore, loadTestFiles} from '../../../test/helpers'; +import {getDeclaration, loadFakeCore, loadTestFiles} from '../../../src/ngtsc/testing'; import {CommonJsReflectionHost} from '../../src/host/commonjs_host'; import {makeTestBundleProgram} from '../helpers/utils'; diff --git a/packages/compiler-cli/ngcc/test/host/commonjs_host_spec.ts b/packages/compiler-cli/ngcc/test/host/commonjs_host_spec.ts index c548908896..fb8315506f 100644 --- a/packages/compiler-cli/ngcc/test/host/commonjs_host_spec.ts +++ b/packages/compiler-cli/ngcc/test/host/commonjs_host_spec.ts @@ -11,8 +11,7 @@ import {absoluteFrom, getFileSystem, getSourceFileOrError} from '../../../src/ng import {runInEachFileSystem, TestFile} from '../../../src/ngtsc/file_system/testing'; import {MockLogger} from '../../../src/ngtsc/logging/testing'; import {ClassMemberKind, ConcreteDeclaration, CtorParameter, DeclarationKind, DownleveledEnum, InlineDeclaration, isNamedClassDeclaration, isNamedFunctionDeclaration, isNamedVariableDeclaration, KnownDeclaration, TypeScriptReflectionHost, TypeValueReferenceKind} from '../../../src/ngtsc/reflection'; -import {getDeclaration} from '../../../src/ngtsc/testing'; -import {loadFakeCore, loadTestFiles} from '../../../test/helpers'; +import {getDeclaration, loadFakeCore, loadTestFiles} from '../../../src/ngtsc/testing'; import {CommonJsReflectionHost} from '../../src/host/commonjs_host'; import {DelegatingReflectionHost} from '../../src/host/delegating_host'; import {getIifeBody} from '../../src/host/esm2015_host'; diff --git a/packages/compiler-cli/ngcc/test/host/esm2015_host_import_helper_spec.ts b/packages/compiler-cli/ngcc/test/host/esm2015_host_import_helper_spec.ts index 20a8c35a8b..411ee039fb 100644 --- a/packages/compiler-cli/ngcc/test/host/esm2015_host_import_helper_spec.ts +++ b/packages/compiler-cli/ngcc/test/host/esm2015_host_import_helper_spec.ts @@ -12,8 +12,7 @@ import {absoluteFrom, getFileSystem, getSourceFileOrError} from '../../../src/ng import {runInEachFileSystem, TestFile} from '../../../src/ngtsc/file_system/testing'; import {MockLogger} from '../../../src/ngtsc/logging/testing'; import {ClassMemberKind, isNamedVariableDeclaration, TypeValueReferenceKind} from '../../../src/ngtsc/reflection'; -import {getDeclaration} from '../../../src/ngtsc/testing'; -import {loadFakeCore, loadTestFiles, loadTsLib} from '../../../test/helpers'; +import {getDeclaration, loadFakeCore, loadTestFiles, loadTsLib} from '../../../src/ngtsc/testing'; import {Esm2015ReflectionHost} from '../../src/host/esm2015_host'; import {convertToDirectTsLibImport, convertToInlineTsLib, makeTestBundleProgram} from '../helpers/utils'; diff --git a/packages/compiler-cli/ngcc/test/host/esm2015_host_spec.ts b/packages/compiler-cli/ngcc/test/host/esm2015_host_spec.ts index a33dda88ae..69a8ff4df5 100644 --- a/packages/compiler-cli/ngcc/test/host/esm2015_host_spec.ts +++ b/packages/compiler-cli/ngcc/test/host/esm2015_host_spec.ts @@ -12,9 +12,7 @@ import {absoluteFrom, getFileSystem, getSourceFileOrError} from '../../../src/ng import {runInEachFileSystem, TestFile} from '../../../src/ngtsc/file_system/testing'; import {MockLogger} from '../../../src/ngtsc/logging/testing'; import {ClassMemberKind, ConcreteDeclaration, CtorParameter, DownleveledEnum, isNamedClassDeclaration, isNamedFunctionDeclaration, isNamedVariableDeclaration, TypeScriptReflectionHost} from '../../../src/ngtsc/reflection'; -import {getDeclaration} from '../../../src/ngtsc/testing'; -import {walkForDeclarations} from '../../../src/ngtsc/testing/src/utils'; -import {loadFakeCore, loadTestFiles} from '../../../test/helpers'; +import {getDeclaration, loadFakeCore, loadTestFiles, walkForDeclarations} from '../../../src/ngtsc/testing'; import {DelegatingReflectionHost} from '../../src/host/delegating_host'; import {Esm2015ReflectionHost} from '../../src/host/esm2015_host'; import {BundleProgram} from '../../src/packages/bundle_program'; diff --git a/packages/compiler-cli/ngcc/test/host/esm5_host_import_helper_spec.ts b/packages/compiler-cli/ngcc/test/host/esm5_host_import_helper_spec.ts index 5e7251bfc3..2950c9c0d7 100644 --- a/packages/compiler-cli/ngcc/test/host/esm5_host_import_helper_spec.ts +++ b/packages/compiler-cli/ngcc/test/host/esm5_host_import_helper_spec.ts @@ -11,8 +11,7 @@ import {absoluteFrom, getFileSystem, getSourceFileOrError} from '../../../src/ng import {runInEachFileSystem, TestFile} from '../../../src/ngtsc/file_system/testing'; import {MockLogger} from '../../../src/ngtsc/logging/testing'; import {ClassMemberKind, isNamedFunctionDeclaration, isNamedVariableDeclaration, TypeValueReferenceKind} from '../../../src/ngtsc/reflection'; -import {getDeclaration} from '../../../src/ngtsc/testing'; -import {loadFakeCore, loadTestFiles, loadTsLib} from '../../../test/helpers'; +import {getDeclaration, loadFakeCore, loadTestFiles, loadTsLib} from '../../../src/ngtsc/testing'; import {getIifeBody} from '../../src/host/esm2015_host'; import {Esm5ReflectionHost} from '../../src/host/esm5_host'; import {convertToDirectTsLibImport, convertToInlineTsLib, makeTestBundleProgram} from '../helpers/utils'; diff --git a/packages/compiler-cli/ngcc/test/host/esm5_host_spec.ts b/packages/compiler-cli/ngcc/test/host/esm5_host_spec.ts index 46d7c5a18f..d258f63c4f 100644 --- a/packages/compiler-cli/ngcc/test/host/esm5_host_spec.ts +++ b/packages/compiler-cli/ngcc/test/host/esm5_host_spec.ts @@ -12,8 +12,7 @@ import {absoluteFrom, getFileSystem, getSourceFileOrError} from '../../../src/ng import {runInEachFileSystem, TestFile} from '../../../src/ngtsc/file_system/testing'; import {MockLogger} from '../../../src/ngtsc/logging/testing'; import {ClassMemberKind, ConcreteDeclaration, CtorParameter, DeclarationKind, Decorator, DownleveledEnum, isNamedClassDeclaration, isNamedFunctionDeclaration, isNamedVariableDeclaration, KnownDeclaration, TypeScriptReflectionHost, TypeValueReferenceKind} from '../../../src/ngtsc/reflection'; -import {getDeclaration} from '../../../src/ngtsc/testing'; -import {loadFakeCore, loadTestFiles} from '../../../test/helpers'; +import {getDeclaration, loadFakeCore, loadTestFiles} from '../../../src/ngtsc/testing'; import {DelegatingReflectionHost} from '../../src/host/delegating_host'; import {Esm2015ReflectionHost, getIifeBody} from '../../src/host/esm2015_host'; import {Esm5ReflectionHost} from '../../src/host/esm5_host'; diff --git a/packages/compiler-cli/ngcc/test/host/umd_host_import_helper_spec.ts b/packages/compiler-cli/ngcc/test/host/umd_host_import_helper_spec.ts index 777703d06b..88b113b817 100644 --- a/packages/compiler-cli/ngcc/test/host/umd_host_import_helper_spec.ts +++ b/packages/compiler-cli/ngcc/test/host/umd_host_import_helper_spec.ts @@ -10,8 +10,7 @@ import {absoluteFrom} from '../../../src/ngtsc/file_system'; import {runInEachFileSystem, TestFile} from '../../../src/ngtsc/file_system/testing'; import {MockLogger} from '../../../src/ngtsc/logging/testing'; import {ClassMemberKind, isNamedVariableDeclaration} from '../../../src/ngtsc/reflection'; -import {getDeclaration} from '../../../src/ngtsc/testing'; -import {loadTestFiles} from '../../../test/helpers'; +import {getDeclaration, loadTestFiles} from '../../../src/ngtsc/testing'; import {UmdReflectionHost} from '../../src/host/umd_host'; import {makeTestBundleProgram} from '../helpers/utils'; diff --git a/packages/compiler-cli/ngcc/test/host/umd_host_spec.ts b/packages/compiler-cli/ngcc/test/host/umd_host_spec.ts index add1647568..870d49edae 100644 --- a/packages/compiler-cli/ngcc/test/host/umd_host_spec.ts +++ b/packages/compiler-cli/ngcc/test/host/umd_host_spec.ts @@ -12,8 +12,7 @@ import {absoluteFrom, getFileSystem, getSourceFileOrError} from '../../../src/ng import {runInEachFileSystem, TestFile} from '../../../src/ngtsc/file_system/testing'; import {MockLogger} from '../../../src/ngtsc/logging/testing'; import {ClassMemberKind, ConcreteDeclaration, CtorParameter, DeclarationKind, DownleveledEnum, Import, InlineDeclaration, isNamedClassDeclaration, isNamedFunctionDeclaration, isNamedVariableDeclaration, KnownDeclaration, TypeScriptReflectionHost, TypeValueReferenceKind} from '../../../src/ngtsc/reflection'; -import {getDeclaration} from '../../../src/ngtsc/testing'; -import {loadFakeCore, loadTestFiles} from '../../../test/helpers'; +import {getDeclaration, loadFakeCore, loadTestFiles} from '../../../src/ngtsc/testing'; import {isExportsDeclaration, isExportsStatement} from '../../src/host/commonjs_umd_utils'; import {DelegatingReflectionHost} from '../../src/host/delegating_host'; import {NgccReflectionHost} from '../../src/host/ngcc_host'; diff --git a/packages/compiler-cli/ngcc/test/integration/ngcc_spec.ts b/packages/compiler-cli/ngcc/test/integration/ngcc_spec.ts index 0bd2af3e83..e1d0e5bdd0 100644 --- a/packages/compiler-cli/ngcc/test/integration/ngcc_spec.ts +++ b/packages/compiler-cli/ngcc/test/integration/ngcc_spec.ts @@ -13,7 +13,7 @@ import * as os from 'os'; import {absoluteFrom, AbsoluteFsPath, FileSystem, getFileSystem, join} from '../../../src/ngtsc/file_system'; import {Folder, MockFileSystem, runInEachFileSystem, TestFile} from '../../../src/ngtsc/file_system/testing'; import {MockLogger} from '../../../src/ngtsc/logging/testing'; -import {loadStandardTestFiles, loadTestFiles} from '../../../test/helpers'; +import {loadStandardTestFiles, loadTestFiles} from '../../../src/ngtsc/testing'; import {getLockFilePath} from '../../src/locking/lock_file'; import {mainNgcc} from '../../src/main'; import {clearTsConfigCache} from '../../src/ngcc_options'; diff --git a/packages/compiler-cli/ngcc/test/integration/util.ts b/packages/compiler-cli/ngcc/test/integration/util.ts index e8ab286ee2..c62984d58d 100644 --- a/packages/compiler-cli/ngcc/test/integration/util.ts +++ b/packages/compiler-cli/ngcc/test/integration/util.ts @@ -11,7 +11,7 @@ import * as ts from 'typescript'; import {FileSystem, getFileSystem} from '../../../src/ngtsc/file_system'; import {MockFileSystemPosix} from '../../../src/ngtsc/file_system/testing'; -import {loadStandardTestFiles} from '../../../test/helpers'; +import {loadStandardTestFiles} from '../../../src/ngtsc/testing'; export type PackageSources = { [path: string]: string; diff --git a/packages/compiler-cli/ngcc/test/migrations/missing_injectable_migration_spec.ts b/packages/compiler-cli/ngcc/test/migrations/missing_injectable_migration_spec.ts index 03d45ffb2d..92de9ca154 100644 --- a/packages/compiler-cli/ngcc/test/migrations/missing_injectable_migration_spec.ts +++ b/packages/compiler-cli/ngcc/test/migrations/missing_injectable_migration_spec.ts @@ -10,7 +10,7 @@ import * as ts from 'typescript'; import {absoluteFrom, AbsoluteFsPath, getFileSystem} from '../../../src/ngtsc/file_system'; import {runInEachFileSystem, TestFile} from '../../../src/ngtsc/file_system/testing'; import {MockLogger} from '../../../src/ngtsc/logging/testing'; -import {loadFakeCore, loadTestFiles} from '../../../test/helpers'; +import {loadFakeCore, loadTestFiles} from '../../../src/ngtsc/testing'; import {DecorationAnalyzer} from '../../src/analysis/decoration_analyzer'; import {NgccReferencesRegistry} from '../../src/analysis/ngcc_references_registry'; import {DecorationAnalyses} from '../../src/analysis/types'; diff --git a/packages/compiler-cli/ngcc/test/migrations/undecorated_parent_migration_spec.ts b/packages/compiler-cli/ngcc/test/migrations/undecorated_parent_migration_spec.ts index a67c5254e1..268be9369a 100644 --- a/packages/compiler-cli/ngcc/test/migrations/undecorated_parent_migration_spec.ts +++ b/packages/compiler-cli/ngcc/test/migrations/undecorated_parent_migration_spec.ts @@ -10,7 +10,7 @@ import * as ts from 'typescript'; import {absoluteFrom, AbsoluteFsPath, getFileSystem} from '../../../src/ngtsc/file_system'; import {runInEachFileSystem, TestFile} from '../../../src/ngtsc/file_system/testing'; import {MockLogger} from '../../../src/ngtsc/logging/testing'; -import {loadFakeCore, loadTestFiles} from '../../../test/helpers'; +import {loadFakeCore, loadTestFiles} from '../../../src/ngtsc/testing'; import {DecorationAnalyzer} from '../../src/analysis/decoration_analyzer'; import {NgccReferencesRegistry} from '../../src/analysis/ngcc_references_registry'; import {Esm2015ReflectionHost} from '../../src/host/esm2015_host'; diff --git a/packages/compiler-cli/ngcc/test/packages/build_marker_spec.ts b/packages/compiler-cli/ngcc/test/packages/build_marker_spec.ts index 0dc303e7e8..dd9b032795 100644 --- a/packages/compiler-cli/ngcc/test/packages/build_marker_spec.ts +++ b/packages/compiler-cli/ngcc/test/packages/build_marker_spec.ts @@ -7,7 +7,7 @@ */ import {absoluteFrom, getFileSystem} from '../../../src/ngtsc/file_system'; import {runInEachFileSystem} from '../../../src/ngtsc/file_system/testing'; -import {loadTestFiles} from '../../../test/helpers'; +import {loadTestFiles} from '../../../src/ngtsc/testing'; import {cleanPackageJson, hasBeenProcessed, markAsProcessed, needsCleaning, NGCC_VERSION} from '../../src/packages/build_marker'; import {EntryPointPackageJson} from '../../src/packages/entry_point'; import {DirectPackageJsonUpdater} from '../../src/writing/package_json_updater'; diff --git a/packages/compiler-cli/ngcc/test/packages/configuration_spec.ts b/packages/compiler-cli/ngcc/test/packages/configuration_spec.ts index e646e9a350..d8227f6443 100644 --- a/packages/compiler-cli/ngcc/test/packages/configuration_spec.ts +++ b/packages/compiler-cli/ngcc/test/packages/configuration_spec.ts @@ -9,7 +9,7 @@ import {createHash} from 'crypto'; import {absoluteFrom, FileSystem, getFileSystem} from '../../../src/ngtsc/file_system'; import {runInEachFileSystem} from '../../../src/ngtsc/file_system/testing'; -import {loadTestFiles} from '../../../test/helpers'; +import {loadTestFiles} from '../../../src/ngtsc/testing'; import {DEFAULT_NGCC_CONFIG, NgccConfiguration, ProcessLockingConfiguration} from '../../src/packages/configuration'; diff --git a/packages/compiler-cli/ngcc/test/packages/entry_point_bundle_spec.ts b/packages/compiler-cli/ngcc/test/packages/entry_point_bundle_spec.ts index a5878794af..32fed41221 100644 --- a/packages/compiler-cli/ngcc/test/packages/entry_point_bundle_spec.ts +++ b/packages/compiler-cli/ngcc/test/packages/entry_point_bundle_spec.ts @@ -7,7 +7,7 @@ */ import {absoluteFrom, getFileSystem} from '../../../src/ngtsc/file_system'; import {runInEachFileSystem} from '../../../src/ngtsc/file_system/testing'; -import {loadTestFiles} from '../../../test/helpers'; +import {loadTestFiles} from '../../../src/ngtsc/testing'; import {EntryPoint} from '../../src/packages/entry_point'; import {makeEntryPointBundle} from '../../src/packages/entry_point_bundle'; import {createModuleResolutionCache, SharedFileCache} from '../../src/packages/source_file_cache'; diff --git a/packages/compiler-cli/ngcc/test/packages/entry_point_manifest_spec.ts b/packages/compiler-cli/ngcc/test/packages/entry_point_manifest_spec.ts index e87d474cae..95b2cb3a20 100644 --- a/packages/compiler-cli/ngcc/test/packages/entry_point_manifest_spec.ts +++ b/packages/compiler-cli/ngcc/test/packages/entry_point_manifest_spec.ts @@ -10,7 +10,7 @@ import {createHash} from 'crypto'; import {absoluteFrom, FileSystem, getFileSystem, relativeFrom} from '../../../src/ngtsc/file_system'; import {runInEachFileSystem} from '../../../src/ngtsc/file_system/testing'; import {MockLogger} from '../../../src/ngtsc/logging/testing'; -import {loadTestFiles} from '../../../test/helpers'; +import {loadTestFiles} from '../../../src/ngtsc/testing'; import {EntryPointWithDependencies} from '../../src/dependencies/dependency_host'; import {NGCC_VERSION} from '../../src/packages/build_marker'; import {NgccConfiguration, ProcessedNgccPackageConfig} from '../../src/packages/configuration'; diff --git a/packages/compiler-cli/ngcc/test/packages/entry_point_spec.ts b/packages/compiler-cli/ngcc/test/packages/entry_point_spec.ts index 5e08f6da26..5e218b671d 100644 --- a/packages/compiler-cli/ngcc/test/packages/entry_point_spec.ts +++ b/packages/compiler-cli/ngcc/test/packages/entry_point_spec.ts @@ -9,7 +9,7 @@ import {absoluteFrom, AbsoluteFsPath, FileSystem, getFileSystem, join, relative} from '../../../src/ngtsc/file_system'; import {runInEachFileSystem} from '../../../src/ngtsc/file_system/testing'; import {MockLogger} from '../../../src/ngtsc/logging/testing'; -import {loadTestFiles} from '../../../test/helpers'; +import {loadTestFiles} from '../../../src/ngtsc/testing'; import {NgccConfiguration, ProcessedNgccPackageConfig} from '../../src/packages/configuration'; import {EntryPoint, EntryPointJsonProperty, getEntryPointFormat, getEntryPointInfo, IGNORED_ENTRY_POINT, INCOMPATIBLE_ENTRY_POINT, isEntryPoint, NO_ENTRY_POINT, SUPPORTED_FORMAT_PROPERTIES} from '../../src/packages/entry_point'; diff --git a/packages/compiler-cli/ngcc/test/packages/source_file_cache_spec.ts b/packages/compiler-cli/ngcc/test/packages/source_file_cache_spec.ts index 8c3ca88089..6459f046dc 100644 --- a/packages/compiler-cli/ngcc/test/packages/source_file_cache_spec.ts +++ b/packages/compiler-cli/ngcc/test/packages/source_file_cache_spec.ts @@ -9,7 +9,7 @@ import * as ts from 'typescript'; import {absoluteFrom, FileSystem, getFileSystem} from '../../../src/ngtsc/file_system'; import {runInEachFileSystem} from '../../../src/ngtsc/file_system/testing'; -import {loadTestFiles} from '../../../test/helpers'; +import {loadTestFiles} from '../../../src/ngtsc/testing'; import {EntryPointFileCache, isAngularDts, isDefaultLibrary, SharedFileCache} from '../../src/packages/source_file_cache'; runInEachFileSystem(() => { diff --git a/packages/compiler-cli/ngcc/test/rendering/commonjs_rendering_formatter_spec.ts b/packages/compiler-cli/ngcc/test/rendering/commonjs_rendering_formatter_spec.ts index a43cdd1d33..495ff9f2fc 100644 --- a/packages/compiler-cli/ngcc/test/rendering/commonjs_rendering_formatter_spec.ts +++ b/packages/compiler-cli/ngcc/test/rendering/commonjs_rendering_formatter_spec.ts @@ -13,9 +13,8 @@ import {absoluteFrom, absoluteFromSourceFile, AbsoluteFsPath, getFileSystem, get import {runInEachFileSystem, TestFile} from '../../../src/ngtsc/file_system/testing'; import {NoopImportRewriter} from '../../../src/ngtsc/imports'; import {MockLogger} from '../../../src/ngtsc/logging/testing'; -import {getDeclaration} from '../../../src/ngtsc/testing'; +import {getDeclaration, loadTestFiles} from '../../../src/ngtsc/testing'; import {ImportManager} from '../../../src/ngtsc/translator'; -import {loadTestFiles} from '../../../test/helpers'; import {DecorationAnalyzer} from '../../src/analysis/decoration_analyzer'; import {NgccReferencesRegistry} from '../../src/analysis/ngcc_references_registry'; import {SwitchMarkerAnalyzer} from '../../src/analysis/switch_marker_analyzer'; diff --git a/packages/compiler-cli/ngcc/test/rendering/dts_renderer_spec.ts b/packages/compiler-cli/ngcc/test/rendering/dts_renderer_spec.ts index eb5a925a3c..1577026df6 100644 --- a/packages/compiler-cli/ngcc/test/rendering/dts_renderer_spec.ts +++ b/packages/compiler-cli/ngcc/test/rendering/dts_renderer_spec.ts @@ -14,8 +14,8 @@ import {absoluteFrom, getFileSystem} from '../../../src/ngtsc/file_system'; import {runInEachFileSystem, TestFile} from '../../../src/ngtsc/file_system/testing'; import {Reexport} from '../../../src/ngtsc/imports'; import {MockLogger} from '../../../src/ngtsc/logging/testing'; +import {loadTestFiles} from '../../../src/ngtsc/testing'; import {Import, ImportManager} from '../../../src/ngtsc/translator'; -import {loadTestFiles} from '../../../test/helpers'; import {DecorationAnalyzer} from '../../src/analysis/decoration_analyzer'; import {ModuleWithProvidersAnalyzer, ModuleWithProvidersInfo} from '../../src/analysis/module_with_providers_analyzer'; import {NgccReferencesRegistry} from '../../src/analysis/ngcc_references_registry'; diff --git a/packages/compiler-cli/ngcc/test/rendering/esm5_rendering_formatter_spec.ts b/packages/compiler-cli/ngcc/test/rendering/esm5_rendering_formatter_spec.ts index 1f74f9287b..039640a149 100644 --- a/packages/compiler-cli/ngcc/test/rendering/esm5_rendering_formatter_spec.ts +++ b/packages/compiler-cli/ngcc/test/rendering/esm5_rendering_formatter_spec.ts @@ -13,9 +13,8 @@ import {absoluteFrom, absoluteFromSourceFile, AbsoluteFsPath, getFileSystem, get import {runInEachFileSystem, TestFile} from '../../../src/ngtsc/file_system/testing'; import {NoopImportRewriter} from '../../../src/ngtsc/imports'; import {MockLogger} from '../../../src/ngtsc/logging/testing'; -import {getDeclaration} from '../../../src/ngtsc/testing'; +import {getDeclaration, loadTestFiles} from '../../../src/ngtsc/testing'; import {ImportManager} from '../../../src/ngtsc/translator'; -import {loadTestFiles} from '../../../test/helpers'; import {DecorationAnalyzer} from '../../src/analysis/decoration_analyzer'; import {NgccReferencesRegistry} from '../../src/analysis/ngcc_references_registry'; import {SwitchMarkerAnalyzer} from '../../src/analysis/switch_marker_analyzer'; diff --git a/packages/compiler-cli/ngcc/test/rendering/esm_rendering_formatter_spec.ts b/packages/compiler-cli/ngcc/test/rendering/esm_rendering_formatter_spec.ts index b34c9a4079..0ac6299d7d 100644 --- a/packages/compiler-cli/ngcc/test/rendering/esm_rendering_formatter_spec.ts +++ b/packages/compiler-cli/ngcc/test/rendering/esm_rendering_formatter_spec.ts @@ -13,8 +13,8 @@ import {absoluteFrom, getFileSystem, getSourceFileOrError} from '../../../src/ng import {runInEachFileSystem, TestFile} from '../../../src/ngtsc/file_system/testing'; import {NoopImportRewriter} from '../../../src/ngtsc/imports'; import {MockLogger} from '../../../src/ngtsc/logging/testing'; +import {loadFakeCore, loadTestFiles} from '../../../src/ngtsc/testing'; import {ImportManager} from '../../../src/ngtsc/translator'; -import {loadFakeCore, loadTestFiles} from '../../../test/helpers'; import {DecorationAnalyzer} from '../../src/analysis/decoration_analyzer'; import {ModuleWithProvidersAnalyzer} from '../../src/analysis/module_with_providers_analyzer'; import {NgccReferencesRegistry} from '../../src/analysis/ngcc_references_registry'; diff --git a/packages/compiler-cli/ngcc/test/rendering/renderer_spec.ts b/packages/compiler-cli/ngcc/test/rendering/renderer_spec.ts index 78121b5dad..98e7a04856 100644 --- a/packages/compiler-cli/ngcc/test/rendering/renderer_spec.ts +++ b/packages/compiler-cli/ngcc/test/rendering/renderer_spec.ts @@ -15,8 +15,8 @@ import {absoluteFrom, getFileSystem} from '../../../src/ngtsc/file_system'; import {runInEachFileSystem, TestFile} from '../../../src/ngtsc/file_system/testing'; import {Reexport} from '../../../src/ngtsc/imports'; import {MockLogger} from '../../../src/ngtsc/logging/testing'; +import {loadTestFiles} from '../../../src/ngtsc/testing'; import {Import, ImportManager, translateStatement} from '../../../src/ngtsc/translator'; -import {loadTestFiles} from '../../../test/helpers'; import {DecorationAnalyzer} from '../../src/analysis/decoration_analyzer'; import {ModuleWithProvidersInfo} from '../../src/analysis/module_with_providers_analyzer'; import {NgccReferencesRegistry} from '../../src/analysis/ngcc_references_registry'; diff --git a/packages/compiler-cli/ngcc/test/rendering/umd_rendering_formatter_spec.ts b/packages/compiler-cli/ngcc/test/rendering/umd_rendering_formatter_spec.ts index 15b35a981c..a667fa7bde 100644 --- a/packages/compiler-cli/ngcc/test/rendering/umd_rendering_formatter_spec.ts +++ b/packages/compiler-cli/ngcc/test/rendering/umd_rendering_formatter_spec.ts @@ -13,9 +13,8 @@ import {absoluteFrom, absoluteFromSourceFile, getFileSystem, getSourceFileOrErro import {runInEachFileSystem, TestFile} from '../../../src/ngtsc/file_system/testing'; import {NoopImportRewriter} from '../../../src/ngtsc/imports'; import {MockLogger} from '../../../src/ngtsc/logging/testing'; -import {getDeclaration} from '../../../src/ngtsc/testing'; +import {getDeclaration, loadTestFiles} from '../../../src/ngtsc/testing'; import {ImportManager} from '../../../src/ngtsc/translator'; -import {loadTestFiles} from '../../../test/helpers'; import {DecorationAnalyzer} from '../../src/analysis/decoration_analyzer'; import {NgccReferencesRegistry} from '../../src/analysis/ngcc_references_registry'; import {SwitchMarkerAnalyzer} from '../../src/analysis/switch_marker_analyzer'; diff --git a/packages/compiler-cli/ngcc/test/writing/in_place_file_writer_spec.ts b/packages/compiler-cli/ngcc/test/writing/in_place_file_writer_spec.ts index a2919eeb04..f75c9c4aed 100644 --- a/packages/compiler-cli/ngcc/test/writing/in_place_file_writer_spec.ts +++ b/packages/compiler-cli/ngcc/test/writing/in_place_file_writer_spec.ts @@ -8,7 +8,7 @@ import {absoluteFrom, getFileSystem} from '../../../src/ngtsc/file_system'; import {runInEachFileSystem} from '../../../src/ngtsc/file_system/testing'; import {MockLogger} from '../../../src/ngtsc/logging/testing'; -import {loadTestFiles} from '../../../test/helpers'; +import {loadTestFiles} from '../../../src/ngtsc/testing'; import {EntryPoint} from '../../src/packages/entry_point'; import {EntryPointBundle} from '../../src/packages/entry_point_bundle'; import {InPlaceFileWriter, NGCC_BACKUP_EXTENSION} from '../../src/writing/in_place_file_writer'; diff --git a/packages/compiler-cli/ngcc/test/writing/new_entry_point_file_writer_spec.ts b/packages/compiler-cli/ngcc/test/writing/new_entry_point_file_writer_spec.ts index 255212a20c..97748efd08 100644 --- a/packages/compiler-cli/ngcc/test/writing/new_entry_point_file_writer_spec.ts +++ b/packages/compiler-cli/ngcc/test/writing/new_entry_point_file_writer_spec.ts @@ -8,7 +8,7 @@ import {absoluteFrom, FileSystem, getFileSystem, join} from '../../../src/ngtsc/file_system'; import {runInEachFileSystem} from '../../../src/ngtsc/file_system/testing'; import {MockLogger} from '../../../src/ngtsc/logging/testing'; -import {loadTestFiles} from '../../../test/helpers'; +import {loadTestFiles} from '../../../src/ngtsc/testing'; import {NgccConfiguration} from '../../src/packages/configuration'; import {EntryPoint, EntryPointFormat, EntryPointJsonProperty, getEntryPointInfo, isEntryPoint} from '../../src/packages/entry_point'; import {EntryPointBundle, makeEntryPointBundle} from '../../src/packages/entry_point_bundle'; diff --git a/packages/compiler-cli/ngcc/test/writing/package_json_updater_spec.ts b/packages/compiler-cli/ngcc/test/writing/package_json_updater_spec.ts index 871c4f41c0..e1981c9a85 100644 --- a/packages/compiler-cli/ngcc/test/writing/package_json_updater_spec.ts +++ b/packages/compiler-cli/ngcc/test/writing/package_json_updater_spec.ts @@ -7,7 +7,7 @@ */ import {absoluteFrom, AbsoluteFsPath, FileSystem, getFileSystem} from '../../../src/ngtsc/file_system'; import {runInEachFileSystem} from '../../../src/ngtsc/file_system/testing'; -import {loadTestFiles} from '../../../test/helpers'; +import {loadTestFiles} from '../../../src/ngtsc/testing'; import {JsonObject} from '../../src/packages/entry_point'; import {DirectPackageJsonUpdater, PackageJsonUpdater} from '../../src/writing/package_json_updater'; diff --git a/packages/compiler-cli/src/ngtsc/testing/BUILD.bazel b/packages/compiler-cli/src/ngtsc/testing/BUILD.bazel index 2fe8466d92..11e83289e6 100644 --- a/packages/compiler-cli/src/ngtsc/testing/BUILD.bazel +++ b/packages/compiler-cli/src/ngtsc/testing/BUILD.bazel @@ -8,9 +8,11 @@ ts_library( srcs = glob([ "**/*.ts", ]), + module_name = "@angular/compiler-cli/src/ngtsc/testing", deps = [ "//packages:types", "//packages/compiler-cli/src/ngtsc/file_system", + "//packages/compiler-cli/src/ngtsc/file_system/testing", "//packages/compiler-cli/src/ngtsc/reflection", "@npm//typescript", ], diff --git a/packages/compiler-cli/test/ngtsc/fake_core/BUILD.bazel b/packages/compiler-cli/src/ngtsc/testing/fake_core/BUILD.bazel similarity index 100% rename from packages/compiler-cli/test/ngtsc/fake_core/BUILD.bazel rename to packages/compiler-cli/src/ngtsc/testing/fake_core/BUILD.bazel diff --git a/packages/compiler-cli/test/ngtsc/fake_core/README.md b/packages/compiler-cli/src/ngtsc/testing/fake_core/README.md similarity index 100% rename from packages/compiler-cli/test/ngtsc/fake_core/README.md rename to packages/compiler-cli/src/ngtsc/testing/fake_core/README.md diff --git a/packages/compiler-cli/test/ngtsc/fake_core/index.ts b/packages/compiler-cli/src/ngtsc/testing/fake_core/index.ts similarity index 94% rename from packages/compiler-cli/test/ngtsc/fake_core/index.ts rename to packages/compiler-cli/src/ngtsc/testing/fake_core/index.ts index 4d9f8d3efb..3acc21ab07 100644 --- a/packages/compiler-cli/test/ngtsc/fake_core/index.ts +++ b/packages/compiler-cli/src/ngtsc/testing/fake_core/index.ts @@ -71,8 +71,7 @@ export interface SimpleChanges { } export type ɵɵNgModuleDefWithMeta = any; -export type ɵɵDirectiveDefWithMeta< - DirT, SelectorT, ExportAsT, InputsT, OutputsT, QueriesT, NgContentSelectorsT> = any; +export type ɵɵDirectiveDefWithMeta = any; export type ɵɵPipeDefWithMeta = any; export enum ViewEncapsulation { @@ -103,3 +102,7 @@ export interface QueryList/* implements Iterable */ { export type NgIterable = Array|Iterable; export class NgZone {} + +export interface PipeTransform { + transform(value: any, ...args: any[]): any; +} \ No newline at end of file diff --git a/packages/compiler-cli/test/ngtsc/fake_core/package.json b/packages/compiler-cli/src/ngtsc/testing/fake_core/package.json similarity index 100% rename from packages/compiler-cli/test/ngtsc/fake_core/package.json rename to packages/compiler-cli/src/ngtsc/testing/fake_core/package.json diff --git a/packages/compiler-cli/src/ngtsc/testing/index.ts b/packages/compiler-cli/src/ngtsc/testing/index.ts index 052bfc8773..fac534ec1d 100644 --- a/packages/compiler-cli/src/ngtsc/testing/index.ts +++ b/packages/compiler-cli/src/ngtsc/testing/index.ts @@ -5,4 +5,7 @@ * Use of this source code is governed by an MIT-style license that can be * found in the LICENSE file at https://angular.io/license */ -export {expectCompleteReuse, getDeclaration, isNamedDeclaration, makeProgram} from './src/utils'; +export * from './src/utils'; +export * from './src/cached_source_files'; +export * from './src/mock_file_loading'; +export * from './src/runfile_helpers'; diff --git a/packages/compiler-cli/test/helpers/src/cached_source_files.ts b/packages/compiler-cli/src/ngtsc/testing/src/cached_source_files.ts similarity index 96% rename from packages/compiler-cli/test/helpers/src/cached_source_files.ts rename to packages/compiler-cli/src/ngtsc/testing/src/cached_source_files.ts index 64dbd95529..c3cde20c8c 100644 --- a/packages/compiler-cli/test/helpers/src/cached_source_files.ts +++ b/packages/compiler-cli/src/ngtsc/testing/src/cached_source_files.ts @@ -7,7 +7,7 @@ */ import * as ts from 'typescript'; -import {basename} from '../../../src/ngtsc/file_system'; +import {basename} from '../../file_system'; // A cache of source files that are typically used across tests and are expensive to parse. let sourceFileCache = new Map(); diff --git a/packages/compiler-cli/test/helpers/src/mock_file_loading.ts b/packages/compiler-cli/src/ngtsc/testing/src/mock_file_loading.ts similarity index 92% rename from packages/compiler-cli/test/helpers/src/mock_file_loading.ts rename to packages/compiler-cli/src/ngtsc/testing/src/mock_file_loading.ts index 7a57578910..a5d80e66a2 100644 --- a/packages/compiler-cli/test/helpers/src/mock_file_loading.ts +++ b/packages/compiler-cli/src/ngtsc/testing/src/mock_file_loading.ts @@ -10,9 +10,9 @@ import {readdirSync, readFileSync, statSync} from 'fs'; import {resolve} from 'path'; -import {getAngularPackagesFromRunfiles, resolveNpmTreeArtifact} from '..'; -import {AbsoluteFsPath, FileSystem, getFileSystem} from '../../../src/ngtsc/file_system'; -import {Folder, MockFileSystemPosix, TestFile} from '../../../src/ngtsc/file_system/testing'; +import {AbsoluteFsPath, FileSystem, getFileSystem} from '../../file_system'; +import {Folder, MockFileSystemPosix, TestFile} from '../../file_system/testing'; +import {getAngularPackagesFromRunfiles, resolveNpmTreeArtifact} from './runfile_helpers'; export function loadTestFiles(files: TestFile[]) { const fs = getFileSystem(); @@ -71,7 +71,9 @@ export function loadTsLib(fs: FileSystem, basePath: string = '/') { export function loadFakeCore(fs: FileSystem, basePath: string = '/') { loadTestDirectory( - fs, resolveNpmTreeArtifact('angular/packages/compiler-cli/test/ngtsc/fake_core/npm_package'), + fs, + resolveNpmTreeArtifact( + 'angular/packages/compiler-cli/src/ngtsc/testing/fake_core/npm_package'), fs.resolve(basePath, 'node_modules/@angular/core')); } diff --git a/packages/compiler-cli/test/helpers/src/runfile_helpers.ts b/packages/compiler-cli/src/ngtsc/testing/src/runfile_helpers.ts similarity index 100% rename from packages/compiler-cli/test/helpers/src/runfile_helpers.ts rename to packages/compiler-cli/src/ngtsc/testing/src/runfile_helpers.ts diff --git a/packages/compiler-cli/test/BUILD.bazel b/packages/compiler-cli/test/BUILD.bazel index 776e7a8684..a0a217a5a5 100644 --- a/packages/compiler-cli/test/BUILD.bazel +++ b/packages/compiler-cli/test/BUILD.bazel @@ -18,7 +18,7 @@ ts_library( "//packages/compiler", "//packages/compiler-cli", "//packages/compiler-cli/src/ngtsc/file_system", - "//packages/compiler-cli/test/helpers", + "//packages/compiler-cli/src/ngtsc/testing", "@npm//typescript", ], ) diff --git a/packages/compiler-cli/test/compliance/full/BUILD.bazel b/packages/compiler-cli/test/compliance/full/BUILD.bazel index a8e2fd4e5a..024b4f2f01 100644 --- a/packages/compiler-cli/test/compliance/full/BUILD.bazel +++ b/packages/compiler-cli/test/compliance/full/BUILD.bazel @@ -14,8 +14,8 @@ jasmine_node_test( name = "full", bootstrap = ["//tools/testing:node_no_angular_es5"], data = [ + "//packages/compiler-cli/src/ngtsc/testing/fake_core:npm_package", "//packages/compiler-cli/test/compliance/test_cases", - "//packages/compiler-cli/test/ngtsc/fake_core:npm_package", ], shard_count = 2, tags = [ diff --git a/packages/compiler-cli/test/compliance/linked/BUILD.bazel b/packages/compiler-cli/test/compliance/linked/BUILD.bazel index e98f95b35d..304127218b 100644 --- a/packages/compiler-cli/test/compliance/linked/BUILD.bazel +++ b/packages/compiler-cli/test/compliance/linked/BUILD.bazel @@ -16,8 +16,8 @@ jasmine_node_test( name = "linked", bootstrap = ["//tools/testing:node_no_angular_es5"], data = [ + "//packages/compiler-cli/src/ngtsc/testing/fake_core:npm_package", "//packages/compiler-cli/test/compliance/test_cases", - "//packages/compiler-cli/test/ngtsc/fake_core:npm_package", ], shard_count = 2, tags = [ diff --git a/packages/compiler-cli/test/compliance/partial/partial_compliance_goldens.bzl b/packages/compiler-cli/test/compliance/partial/partial_compliance_goldens.bzl index edbf9029dc..5ebd956a98 100644 --- a/packages/compiler-cli/test/compliance/partial/partial_compliance_goldens.bzl +++ b/packages/compiler-cli/test/compliance/partial/partial_compliance_goldens.bzl @@ -13,7 +13,7 @@ def partial_compliance_golden(filePath): data = [ "//packages/compiler-cli/test/compliance/partial:generate_golden_partial_lib", "//packages/compiler-cli/test/compliance/test_cases", - "//packages/compiler-cli/test/ngtsc/fake_core:npm_package", + "//packages/compiler-cli/src/ngtsc/testing/fake_core:npm_package", ], visibility = [":__pkg__"], entry_point = "//packages/compiler-cli/test/compliance/partial:cli.ts", @@ -37,7 +37,7 @@ def partial_compliance_golden(filePath): data = [ "//packages/compiler-cli/test/compliance/partial:generate_golden_partial_lib", "//packages/compiler-cli/test/compliance/test_cases", - "//packages/compiler-cli/test/ngtsc/fake_core:npm_package", + "//packages/compiler-cli/src/ngtsc/testing/fake_core:npm_package", ], ) diff --git a/packages/compiler-cli/test/compliance/test_helpers/BUILD.bazel b/packages/compiler-cli/test/compliance/test_helpers/BUILD.bazel index bf4e4af039..2f6e61ad85 100644 --- a/packages/compiler-cli/test/compliance/test_helpers/BUILD.bazel +++ b/packages/compiler-cli/test/compliance/test_helpers/BUILD.bazel @@ -15,7 +15,7 @@ ts_library( "//packages/compiler-cli", "//packages/compiler-cli/src/ngtsc/file_system", "//packages/compiler-cli/src/ngtsc/file_system/testing", - "//packages/compiler-cli/test/helpers", + "//packages/compiler-cli/src/ngtsc/testing", "@npm//typescript", ], ) diff --git a/packages/compiler-cli/test/compliance/test_helpers/compile_test.ts b/packages/compiler-cli/test/compliance/test_helpers/compile_test.ts index 3b96d635ff..297dd3181c 100644 --- a/packages/compiler-cli/test/compliance/test_helpers/compile_test.ts +++ b/packages/compiler-cli/test/compliance/test_helpers/compile_test.ts @@ -9,9 +9,9 @@ import * as ts from 'typescript'; import {AbsoluteFsPath, FileSystem, NgtscCompilerHost} from '../../../src/ngtsc/file_system'; import {initMockFileSystem} from '../../../src/ngtsc/file_system/testing'; +import {loadStandardTestFiles, loadTestDirectory} from '../../../src/ngtsc/testing'; import {performCompilation} from '../../../src/perform_compile'; import {CompilerOptions} from '../../../src/transformers/api'; -import {loadStandardTestFiles, loadTestDirectory} from '../../helpers'; import {ConfigOptions} from './get_compliance_tests'; diff --git a/packages/compiler-cli/test/compliance_old/BUILD.bazel b/packages/compiler-cli/test/compliance_old/BUILD.bazel index 3018c66b42..3635c4b97f 100644 --- a/packages/compiler-cli/test/compliance_old/BUILD.bazel +++ b/packages/compiler-cli/test/compliance_old/BUILD.bazel @@ -24,7 +24,7 @@ jasmine_node_test( name = "compliance_old", bootstrap = ["//tools/testing:node_no_angular_es5"], data = [ - "//packages/compiler-cli/test/ngtsc/fake_core:npm_package", + "//packages/compiler-cli/src/ngtsc/testing/fake_core:npm_package", ], shard_count = 2, tags = [ diff --git a/packages/compiler-cli/test/compliance_old/prelink/BUILD.bazel b/packages/compiler-cli/test/compliance_old/prelink/BUILD.bazel index eed261d4c0..f665fa9a0d 100644 --- a/packages/compiler-cli/test/compliance_old/prelink/BUILD.bazel +++ b/packages/compiler-cli/test/compliance_old/prelink/BUILD.bazel @@ -25,7 +25,7 @@ jasmine_node_test( ":prelink_bootstrap_es5", ], data = [ - "//packages/compiler-cli/test/ngtsc/fake_core:npm_package", + "//packages/compiler-cli/src/ngtsc/testing/fake_core:npm_package", ], shard_count = 4, tags = [ diff --git a/packages/compiler-cli/test/helpers/BUILD.bazel b/packages/compiler-cli/test/helpers/BUILD.bazel deleted file mode 100644 index 480e618f04..0000000000 --- a/packages/compiler-cli/test/helpers/BUILD.bazel +++ /dev/null @@ -1,18 +0,0 @@ -load("//tools:defaults.bzl", "ts_library") - -package(default_visibility = ["//visibility:public"]) - -ts_library( - name = "helpers", - testonly = True, - srcs = glob([ - "**/*.ts", - ]), - module_name = "@angular/compiler-cli/test/helpers", - deps = [ - "//packages:types", - "//packages/compiler-cli/src/ngtsc/file_system", - "//packages/compiler-cli/src/ngtsc/file_system/testing", - "@npm//typescript", - ], -) diff --git a/packages/compiler-cli/test/helpers/index.ts b/packages/compiler-cli/test/helpers/index.ts deleted file mode 100644 index 5c504e39cf..0000000000 --- a/packages/compiler-cli/test/helpers/index.ts +++ /dev/null @@ -1,10 +0,0 @@ -/** - * @license - * Copyright Google LLC All Rights Reserved. - * - * Use of this source code is governed by an MIT-style license that can be - * found in the LICENSE file at https://angular.io/license - */ -export {getAngularPackagesFromRunfiles, resolveNpmTreeArtifact} from './src/runfile_helpers'; -export * from './src/mock_file_loading'; -export * from './src/cached_source_files'; diff --git a/packages/compiler-cli/test/ngtsc/BUILD.bazel b/packages/compiler-cli/test/ngtsc/BUILD.bazel index 20359c531c..b9c68a775d 100644 --- a/packages/compiler-cli/test/ngtsc/BUILD.bazel +++ b/packages/compiler-cli/test/ngtsc/BUILD.bazel @@ -16,7 +16,6 @@ ts_library( "//packages/compiler-cli/src/ngtsc/testing", "//packages/compiler-cli/src/ngtsc/util", "//packages/compiler-cli/test:test_utils", - "//packages/compiler-cli/test/helpers", "@npm//source-map", "@npm//typescript", ], @@ -27,7 +26,7 @@ jasmine_node_test( timeout = "long", bootstrap = ["//tools/testing:node_no_angular_es5"], data = [ - "//packages/compiler-cli/test/ngtsc/fake_core:npm_package", + "//packages/compiler-cli/src/ngtsc/testing/fake_core:npm_package", ], shard_count = 4, deps = [ diff --git a/packages/compiler-cli/test/ngtsc/env.ts b/packages/compiler-cli/test/ngtsc/env.ts index 9cf9c48dfd..a57eefb0f8 100644 --- a/packages/compiler-cli/test/ngtsc/env.ts +++ b/packages/compiler-cli/test/ngtsc/env.ts @@ -18,8 +18,8 @@ import {IndexedComponent} from '../../src/ngtsc/indexer'; import {NgtscProgram} from '../../src/ngtsc/program'; import {DeclarationNode} from '../../src/ngtsc/reflection'; import {LazyRoute} from '../../src/ngtsc/routing'; +import {getCachedSourceFile} from '../../src/ngtsc/testing'; import {setWrapHostForTest} from '../../src/transformers/compiler_host'; -import {getCachedSourceFile} from '../helpers'; /** diff --git a/packages/compiler-cli/test/ngtsc/incremental_error_spec.ts b/packages/compiler-cli/test/ngtsc/incremental_error_spec.ts index 19464b1c41..ef3e020e2c 100644 --- a/packages/compiler-cli/test/ngtsc/incremental_error_spec.ts +++ b/packages/compiler-cli/test/ngtsc/incremental_error_spec.ts @@ -8,7 +8,7 @@ import {absoluteFrom as _} from '../../src/ngtsc/file_system'; import {runInEachFileSystem} from '../../src/ngtsc/file_system/testing'; -import {loadStandardTestFiles} from '../helpers/src/mock_file_loading'; +import {loadStandardTestFiles} from '../../src/ngtsc/testing'; import {NgtscTestEnvironment} from './env'; diff --git a/packages/compiler-cli/test/ngtsc/incremental_spec.ts b/packages/compiler-cli/test/ngtsc/incremental_spec.ts index 59be3f750d..757491bd2e 100644 --- a/packages/compiler-cli/test/ngtsc/incremental_spec.ts +++ b/packages/compiler-cli/test/ngtsc/incremental_spec.ts @@ -7,7 +7,7 @@ */ import {runInEachFileSystem} from '../../src/ngtsc/file_system/testing'; -import {loadStandardTestFiles} from '../helpers/src/mock_file_loading'; +import {loadStandardTestFiles} from '../../src/ngtsc/testing'; import {NgtscTestEnvironment} from './env'; diff --git a/packages/compiler-cli/test/ngtsc/modulewithproviders_spec.ts b/packages/compiler-cli/test/ngtsc/modulewithproviders_spec.ts index 7a4117058b..fa292f7edf 100644 --- a/packages/compiler-cli/test/ngtsc/modulewithproviders_spec.ts +++ b/packages/compiler-cli/test/ngtsc/modulewithproviders_spec.ts @@ -7,7 +7,7 @@ */ import {runInEachFileSystem} from '../../src/ngtsc/file_system/testing'; -import {loadStandardTestFiles} from '../helpers/src/mock_file_loading'; +import {loadStandardTestFiles} from '../../src/ngtsc/testing'; import {NgtscTestEnvironment} from './env'; diff --git a/packages/compiler-cli/test/ngtsc/monorepo_spec.ts b/packages/compiler-cli/test/ngtsc/monorepo_spec.ts index f5f83552d9..34bfa892d9 100644 --- a/packages/compiler-cli/test/ngtsc/monorepo_spec.ts +++ b/packages/compiler-cli/test/ngtsc/monorepo_spec.ts @@ -8,7 +8,7 @@ import {absoluteFrom} from '../../src/ngtsc/file_system'; import {runInEachFileSystem} from '../../src/ngtsc/file_system/testing'; -import {loadStandardTestFiles} from '../helpers/src/mock_file_loading'; +import {loadStandardTestFiles} from '../../src/ngtsc/testing'; import {NgtscTestEnvironment} from './env'; diff --git a/packages/compiler-cli/test/ngtsc/ngtsc_spec.ts b/packages/compiler-cli/test/ngtsc/ngtsc_spec.ts index cbf673384f..ec5a66191a 100644 --- a/packages/compiler-cli/test/ngtsc/ngtsc_spec.ts +++ b/packages/compiler-cli/test/ngtsc/ngtsc_spec.ts @@ -13,8 +13,8 @@ import {ErrorCode, ngErrorCode} from '../../src/ngtsc/diagnostics'; import {absoluteFrom} from '../../src/ngtsc/file_system'; import {runInEachFileSystem} from '../../src/ngtsc/file_system/testing'; import {LazyRoute} from '../../src/ngtsc/routing'; +import {loadStandardTestFiles} from '../../src/ngtsc/testing'; import {restoreTypeScriptVersionForTesting, setTypeScriptVersionForTesting} from '../../src/typescript_support'; -import {loadStandardTestFiles} from '../helpers/src/mock_file_loading'; import {NgtscTestEnvironment} from './env'; diff --git a/packages/compiler-cli/test/ngtsc/scope_spec.ts b/packages/compiler-cli/test/ngtsc/scope_spec.ts index 69a8b88947..e0037e23b8 100644 --- a/packages/compiler-cli/test/ngtsc/scope_spec.ts +++ b/packages/compiler-cli/test/ngtsc/scope_spec.ts @@ -11,8 +11,8 @@ import * as ts from 'typescript'; import {ErrorCode, ngErrorCode} from '../../src/ngtsc/diagnostics'; import {runInEachFileSystem} from '../../src/ngtsc/file_system/testing'; +import {loadStandardTestFiles} from '../../src/ngtsc/testing'; import {getTokenAtPosition} from '../../src/ngtsc/util/src/typescript'; -import {loadStandardTestFiles} from '../helpers/src/mock_file_loading'; import {NgtscTestEnvironment} from './env'; diff --git a/packages/compiler-cli/test/ngtsc/template_mapping_spec.ts b/packages/compiler-cli/test/ngtsc/template_mapping_spec.ts index c830f30f8e..c5711c4769 100644 --- a/packages/compiler-cli/test/ngtsc/template_mapping_spec.ts +++ b/packages/compiler-cli/test/ngtsc/template_mapping_spec.ts @@ -10,8 +10,8 @@ import {inspect} from 'util'; import {runInEachFileSystem} from '../../src/ngtsc/file_system/testing'; +import {loadStandardTestFiles} from '../../src/ngtsc/testing'; import {tsSourceMapBug29300Fixed} from '../../src/ngtsc/util/src/ts_source_map_bug_29300'; -import {loadStandardTestFiles} from '../helpers/src/mock_file_loading'; import {NgtscTestEnvironment} from './env'; import {getMappedSegments, SegmentMapping} from './sourcemap_utils'; diff --git a/packages/compiler-cli/test/ngtsc/template_typecheck_spec.ts b/packages/compiler-cli/test/ngtsc/template_typecheck_spec.ts index 80d0f20199..2e9164e297 100644 --- a/packages/compiler-cli/test/ngtsc/template_typecheck_spec.ts +++ b/packages/compiler-cli/test/ngtsc/template_typecheck_spec.ts @@ -11,8 +11,7 @@ import * as ts from 'typescript'; import {ErrorCode, ngErrorCode} from '../../src/ngtsc/diagnostics'; import {absoluteFrom as _, getFileSystem, getSourceFileOrError} from '../../src/ngtsc/file_system'; import {runInEachFileSystem} from '../../src/ngtsc/file_system/testing'; -import {expectCompleteReuse} from '../../src/ngtsc/testing'; -import {loadStandardTestFiles} from '../helpers/src/mock_file_loading'; +import {expectCompleteReuse, loadStandardTestFiles} from '../../src/ngtsc/testing'; import {NgtscTestEnvironment} from './env'; diff --git a/packages/compiler-cli/test/test_support.ts b/packages/compiler-cli/test/test_support.ts index 110ef37e6d..b0464988b8 100644 --- a/packages/compiler-cli/test/test_support.ts +++ b/packages/compiler-cli/test/test_support.ts @@ -12,7 +12,7 @@ import * as ts from 'typescript'; import * as ng from '../index'; import {NodeJSFileSystem, setFileSystem} from '../src/ngtsc/file_system'; -import {getAngularPackagesFromRunfiles, resolveNpmTreeArtifact} from '../test/helpers'; +import {getAngularPackagesFromRunfiles, resolveNpmTreeArtifact} from '../src/ngtsc/testing'; // TEST_TMPDIR is always set by Bazel. const tmpdir = process.env.TEST_TMPDIR!; diff --git a/packages/compiler/test/BUILD.bazel b/packages/compiler/test/BUILD.bazel index 53444e2738..c2a43aea1c 100644 --- a/packages/compiler/test/BUILD.bazel +++ b/packages/compiler/test/BUILD.bazel @@ -29,7 +29,7 @@ ts_library( "//packages:types", "//packages/compiler", "//packages/compiler-cli", - "//packages/compiler-cli/test/helpers", + "//packages/compiler-cli/src/ngtsc/testing", "@npm//typescript", ], ) diff --git a/packages/compiler/test/aot/test_util.ts b/packages/compiler/test/aot/test_util.ts index 006678439a..41d6a3858f 100644 --- a/packages/compiler/test/aot/test_util.ts +++ b/packages/compiler/test/aot/test_util.ts @@ -10,7 +10,7 @@ import {AotCompilerHost, AotCompilerOptions, createAotCompiler, GeneratedFile, t import {MetadataBundlerHost} from '@angular/compiler-cli/src/metadata/bundler'; import {MetadataCollector} from '@angular/compiler-cli/src/metadata/collector'; import {ModuleMetadata} from '@angular/compiler-cli/src/metadata/index'; -import {getCachedSourceFile} from '@angular/compiler-cli/test/helpers'; +import {getCachedSourceFile} from '@angular/compiler-cli/src/ngtsc/testing'; import {newArray} from '@angular/compiler/src/util'; import * as fs from 'fs'; import * as path from 'path'; @@ -688,7 +688,7 @@ export function setup(options: { if (options.compileFakeCore) { readBazelWrittenFilesFrom( resolveNpmTreeArtifact( - 'angular/packages/compiler-cli/test/ngtsc/fake_core/npm_package'), + 'angular/packages/compiler-cli/src/ngtsc/testing/fake_core/npm_package'), 'core', angularFiles, skipDirs); } if (options.compileAnimations) { diff --git a/packages/localize/src/tools/test/extract/integration/BUILD.bazel b/packages/localize/src/tools/test/extract/integration/BUILD.bazel index 37d9fdc252..7bbc57a8a8 100644 --- a/packages/localize/src/tools/test/extract/integration/BUILD.bazel +++ b/packages/localize/src/tools/test/extract/integration/BUILD.bazel @@ -12,7 +12,7 @@ ts_library( "//packages/compiler-cli/src/ngtsc/file_system/testing", "//packages/compiler-cli/src/ngtsc/logging", "//packages/compiler-cli/src/ngtsc/logging/testing", - "//packages/compiler-cli/test/helpers", + "//packages/compiler-cli/src/ngtsc/testing", "//packages/localize/src/tools", "//packages/localize/src/tools/test:test_lib", ], diff --git a/packages/localize/src/tools/test/extract/integration/main_spec.ts b/packages/localize/src/tools/test/extract/integration/main_spec.ts index 650c91e953..ad19fec321 100644 --- a/packages/localize/src/tools/test/extract/integration/main_spec.ts +++ b/packages/localize/src/tools/test/extract/integration/main_spec.ts @@ -9,7 +9,7 @@ import {absoluteFrom, AbsoluteFsPath, FileSystem, getFileSystem, setFileSystem} import {InvalidFileSystem} from '@angular/compiler-cli/src/ngtsc/file_system/src/invalid_file_system'; import {runInEachFileSystem} from '@angular/compiler-cli/src/ngtsc/file_system/testing'; import {MockLogger} from '@angular/compiler-cli/src/ngtsc/logging/testing'; -import {loadTestDirectory} from '@angular/compiler-cli/test/helpers'; +import {loadTestDirectory} from '@angular/compiler-cli/src/ngtsc/testing'; import {extractTranslations} from '../../../src/extract/main'; import {FormatOptions} from '../../../src/extract/translation_files/format_options'; diff --git a/packages/localize/src/tools/test/translate/integration/BUILD.bazel b/packages/localize/src/tools/test/translate/integration/BUILD.bazel index eb8fca76a1..ec88d4f317 100644 --- a/packages/localize/src/tools/test/translate/integration/BUILD.bazel +++ b/packages/localize/src/tools/test/translate/integration/BUILD.bazel @@ -10,7 +10,7 @@ ts_library( "//packages:types", "//packages/compiler-cli/src/ngtsc/file_system", "//packages/compiler-cli/src/ngtsc/file_system/testing", - "//packages/compiler-cli/test/helpers", + "//packages/compiler-cli/src/ngtsc/testing", "//packages/localize/src/tools", ], ) diff --git a/packages/localize/src/tools/test/translate/integration/main_spec.ts b/packages/localize/src/tools/test/translate/integration/main_spec.ts index 0736dc5a17..fd8eb2ea9d 100644 --- a/packages/localize/src/tools/test/translate/integration/main_spec.ts +++ b/packages/localize/src/tools/test/translate/integration/main_spec.ts @@ -7,7 +7,7 @@ */ import {absoluteFrom, AbsoluteFsPath, FileSystem, getFileSystem} from '@angular/compiler-cli/src/ngtsc/file_system'; import {runInEachFileSystem} from '@angular/compiler-cli/src/ngtsc/file_system/testing'; -import {loadTestDirectory} from '@angular/compiler-cli/test/helpers'; +import {loadTestDirectory} from '@angular/compiler-cli/src/ngtsc/testing'; import {resolve as realResolve} from 'path'; import {Diagnostics} from '../../../src/diagnostics';