ngx-testing-tools
Version:
Makes Angular testing easier
1 lines • 145 kB
Source Map (JSON)
{"version":3,"file":"ngx-testing-tools.mjs","sources":["../../../projects/ngx-testing-tools/src/lib/common/utils/async.util.ts","../../../projects/ngx-testing-tools/src/lib/common/jasmine/jasmine-done.ts","../../../projects/ngx-testing-tools/src/lib/common/jasmine/jasmine-callback.ts","../../../projects/ngx-testing-tools/src/lib/common/test-beds/base/merge-base-factory.ts","../../../projects/ngx-testing-tools/src/lib/common/test-beds/renderer/merge-renderer-factory.ts","../../../projects/ngx-testing-tools/src/lib/common/annotations/annotation.ts","../../../projects/ngx-testing-tools/src/lib/common/annotations/component-annotation.ts","../../../projects/ngx-testing-tools/src/lib/common/errors/throw-ctor-error.ts","../../../projects/ngx-testing-tools/src/lib/common/assertions/assert-component-ctor.ts","../../../projects/ngx-testing-tools/src/lib/common/errors/throw-instance-error.ts","../../../projects/ngx-testing-tools/src/lib/common/assertions/assert-instance.ts","../../../projects/ngx-testing-tools/src/lib/common/expectations/should-create.ts","../../../projects/ngx-testing-tools/src/lib/common/utils/array.util.ts","../../../projects/ngx-testing-tools/src/lib/common/utils/set.util.ts","../../../projects/ngx-testing-tools/src/lib/common/test-beds/base/base-test-bed-factory.ts","../../../projects/ngx-testing-tools/src/lib/common/test-beds/renderer/renderer-test-bed-factory.ts","../../../projects/ngx-testing-tools/src/lib/common/tools/http/http-providers.ts","../../../projects/ngx-testing-tools/src/lib/common/tools/store/injected.ts","../../../projects/ngx-testing-tools/src/lib/common/tools/base/rx/rx-box.ts","../../../projects/ngx-testing-tools/src/lib/common/tools/base/base-tools.ts","../../../projects/ngx-testing-tools/src/lib/common/tools/http/utils/emit-error-response.ts","../../../projects/ngx-testing-tools/src/lib/common/tools/http/utils/emit-success-response.ts","../../../projects/ngx-testing-tools/src/lib/common/tools/http/http-tools.ts","../../../projects/ngx-testing-tools/src/lib/common/tools/renderer/query/utils/cannot-find.ts","../../../projects/ngx-testing-tools/src/lib/common/tools/renderer/query/utils/find-debug-element.ts","../../../projects/ngx-testing-tools/src/lib/common/tools/renderer/action/utils/event.ts","../../../projects/ngx-testing-tools/src/lib/common/tools/renderer/action/utils/output.ts","../../../projects/ngx-testing-tools/src/lib/common/tools/renderer/action/utils/click.ts","../../../projects/ngx-testing-tools/src/lib/common/tools/renderer/action/action-tools.ts","../../../projects/ngx-testing-tools/src/lib/common/tools/renderer/query/utils/find-all-debug-elements.ts","../../../projects/ngx-testing-tools/src/lib/common/tools/renderer/query/utils/find-all-components.ts","../../../projects/ngx-testing-tools/src/lib/common/tools/renderer/query/utils/find-all-elements.ts","../../../projects/ngx-testing-tools/src/lib/common/tools/renderer/query/utils/find-component.ts","../../../projects/ngx-testing-tools/src/lib/common/tools/renderer/query/utils/find-element.ts","../../../projects/ngx-testing-tools/src/lib/common/tools/renderer/query/query-tools.ts","../../../projects/ngx-testing-tools/src/lib/common/tools/renderer/renderer-tools.ts","../../../projects/ngx-testing-tools/src/lib/component-test-bed/tools/component-tools.ts","../../../projects/ngx-testing-tools/src/lib/component-test-bed/component-test-bed-factory.ts","../../../projects/ngx-testing-tools/src/lib/component-test-bed/component-test-bed.ts","../../../projects/ngx-testing-tools/src/lib/common/annotations/directive-annotation.ts","../../../projects/ngx-testing-tools/src/lib/common/assertions/assert-directive-ctor.ts","../../../projects/ngx-testing-tools/src/lib/directive-test-bed/host/host-fixture.token.ts","../../../projects/ngx-testing-tools/src/lib/directive-test-bed/host/host-element-ref.ts","../../../projects/ngx-testing-tools/src/lib/directive-test-bed/tools/directive-tools.ts","../../../projects/ngx-testing-tools/src/lib/directive-test-bed/directive-test-bed-factory.ts","../../../projects/ngx-testing-tools/src/lib/directive-test-bed/directive-test-bed.ts","../../../projects/ngx-testing-tools/src/lib/common/annotations/injectable-annotation.ts","../../../projects/ngx-testing-tools/src/lib/common/assertions/assert-service-ctor.ts","../../../projects/ngx-testing-tools/src/lib/service-test-bed/tools/service-tools.ts","../../../projects/ngx-testing-tools/src/lib/service-test-bed/service-test-bed-factory.ts","../../../projects/ngx-testing-tools/src/lib/service-test-bed/service-test-bed.ts","../../../projects/ngx-testing-tools/src/lib/common/annotations/ng-module-annotation.ts","../../../projects/ngx-testing-tools/src/lib/common/assertions/assert-module-ctor.ts","../../../projects/ngx-testing-tools/src/lib/module-test-bed/tools/module-tools.ts","../../../projects/ngx-testing-tools/src/lib/module-test-bed/module-test-bed-factory.ts","../../../projects/ngx-testing-tools/src/lib/module-test-bed/module-test-bed.ts","../../../projects/ngx-testing-tools/src/lib/common/annotations/pipe-annotation.ts","../../../projects/ngx-testing-tools/src/lib/common/assertions/assert-pipe-ctor.ts","../../../projects/ngx-testing-tools/src/lib/pipe-test-bed/tools/verify/verify-tools.ts","../../../projects/ngx-testing-tools/src/lib/pipe-test-bed/tools/pipe-tools.ts","../../../projects/ngx-testing-tools/src/lib/pipe-test-bed/pipe-test-bed-factory.ts","../../../projects/ngx-testing-tools/src/lib/pipe-test-bed/pipe-test-bed.ts","../../../projects/ngx-testing-tools/src/lib/common/assertions/assert-fn.ts","../../../projects/ngx-testing-tools/src/lib/common/assertions/assert-injectable-ctor.ts","../../../projects/ngx-testing-tools/src/lib/common/assertions/assert-interceptor-ctor.ts","../../../projects/ngx-testing-tools/src/lib/common/utils/constructor.util.ts","../../../projects/ngx-testing-tools/src/lib/interceptor-test-bed/proxy/interceptor-info.token.ts","../../../projects/ngx-testing-tools/src/lib/interceptor-test-bed/proxy/interceptor-proxy.ts","../../../projects/ngx-testing-tools/src/lib/interceptor-test-bed/tools/inspect/utils/handlers/mock-error-response-handler.ts","../../../projects/ngx-testing-tools/src/lib/interceptor-test-bed/tools/inspect/utils/inspect-error-response.ts","../../../projects/ngx-testing-tools/src/lib/interceptor-test-bed/tools/inspect/utils/handlers/mock-request-handler.ts","../../../projects/ngx-testing-tools/src/lib/interceptor-test-bed/tools/inspect/utils/inspect-request.ts","../../../projects/ngx-testing-tools/src/lib/interceptor-test-bed/tools/inspect/utils/handlers/mock-success-response-handler.ts","../../../projects/ngx-testing-tools/src/lib/interceptor-test-bed/tools/inspect/utils/inspect-success-response.ts","../../../projects/ngx-testing-tools/src/lib/interceptor-test-bed/tools/inspect/inspect-tools.ts","../../../projects/ngx-testing-tools/src/lib/interceptor-test-bed/tools/interceptor-tools.ts","../../../projects/ngx-testing-tools/src/lib/interceptor-test-bed/interceptor-test-bed-factory.ts","../../../projects/ngx-testing-tools/src/lib/interceptor-test-bed/interceptor-test-bed.ts","../../../projects/ngx-testing-tools/src/lib/router-test-bed/tools/router-tools.ts","../../../projects/ngx-testing-tools/src/lib/router-test-bed/router-test-bed-factory.ts","../../../projects/ngx-testing-tools/src/lib/router-test-bed/router-test-bed.ts","../../../projects/ngx-testing-tools/src/lib/common/assertions/assert-guard-cto.ts","../../../projects/ngx-testing-tools/src/lib/guard-test-bed/proxy/guard-info.token.ts","../../../projects/ngx-testing-tools/src/lib/guard-test-bed/proxy/guard-proxy.ts","../../../projects/ngx-testing-tools/src/lib/common/utils/router.util.ts","../../../projects/ngx-testing-tools/src/lib/guard-test-bed/utils/guard.util.ts","../../../projects/ngx-testing-tools/src/lib/guard-test-bed/tools/challenge/challenge-tools.ts","../../../projects/ngx-testing-tools/src/lib/guard-test-bed/tools/guard-tools.ts","../../../projects/ngx-testing-tools/src/lib/guard-test-bed/guard-test-bed-factory.ts","../../../projects/ngx-testing-tools/src/lib/guard-test-bed/guard-test-bed.ts","../../../projects/ngx-testing-tools/src/lib/common/assertions/assert-resolver-ctor.ts","../../../projects/ngx-testing-tools/src/lib/resolver-test-bed/proxy/resolver-info.token.ts","../../../projects/ngx-testing-tools/src/lib/resolver-test-bed/proxy/resolver-proxy.ts","../../../projects/ngx-testing-tools/src/lib/resolver-test-bed/tools/trigger/trigger-tools.ts","../../../projects/ngx-testing-tools/src/lib/resolver-test-bed/tools/resolver-tools.ts","../../../projects/ngx-testing-tools/src/lib/resolver-test-bed/resolver-test-bed-factory.ts","../../../projects/ngx-testing-tools/src/lib/resolver-test-bed/resolver-test-bed.ts","../../../projects/ngx-testing-tools/src/public-api.ts","../../../projects/ngx-testing-tools/src/ngx-testing-tools.ts"],"sourcesContent":["import { MaybePromise } from '../shared.models';\n\nexport async function postAsync(value: MaybePromise<unknown>, postAction: () => void): Promise<void> {\n await value;\n postAction();\n}\n","export function buildJasmineDone(done: DoneFn, postAction: () => void): DoneFn {\n const doneWrapper: DoneFn = (() => {\n done();\n postAction();\n }) as DoneFn;\n\n doneWrapper.fail = (message: string | Error | undefined) => {\n try {\n done.fail(message);\n }\n catch (err: unknown) {\n postAction();\n throw err;\n }\n };\n\n return doneWrapper;\n}\n","import { Nullable } from '../shared.models';\nimport { BaseTools } from '../tools/base/models/base-tools.model';\nimport { DeferredTools } from '../tools/models/deferred-tools.model';\nimport { postAsync } from '../utils/async.util';\nimport { buildJasmineDone } from './jasmine-done';\nimport { EnhancedJasmineCallback } from './models/enhanced-jasmine-callback.model';\nimport { JasmineCallback } from './models/jasmine-callback.model';\n\ninterface JasmineCallbackArgs<Tools extends BaseTools> {\n callback: EnhancedJasmineCallback<Tools>;\n deferredTools: DeferredTools<Tools>,\n preTest?: (tools: Tools) => void;\n postTest?: (tools: Tools) => void;\n}\n\nexport function buildJasmineCallback<Tools extends BaseTools>(args: JasmineCallbackArgs<Tools>): JasmineCallback {\n const { callback, deferredTools, preTest, postTest } = args;\n\n const callbackWrapper = (done: Nullable<DoneFn>) => {\n const tools: Tools = deferredTools();\n\n preTest?.(tools);\n\n return (done)\n ? callback(tools, buildJasmineDone(done, () => postTest?.(tools)))\n : postAsync(callback(tools, null!), () => postTest?.(tools));\n };\n\n return (callback.length > 1)\n ? (done: DoneFn) => callbackWrapper(done)\n : () => callbackWrapper(null);\n}\n","import { BaseTestBedFactory } from './base-test-bed-factory';\n\nexport function mergeBaseFactory<F extends BaseTestBedFactory<unknown>, TB>(factory: F, tb: TB & F): TB {\n tb.import = (imports: any) => {\n factory.import(imports);\n return tb;\n };\n tb.provide = (providers: any) => {\n factory.provide(providers);\n return tb;\n };\n tb.inject = (name, token) => {\n factory.inject(name, token);\n return tb;\n };\n tb._compileEach = factory._compileEach.bind(factory);\n tb._shouldCreate = factory._shouldCreate.bind(factory);\n tb.compile = factory.compile.bind(factory);\n tb.setup = factory.setup.bind(factory);\n\n return tb;\n}\n","import { mergeBaseFactory } from '../base/merge-base-factory';\nimport { RendererTestBedFactory } from './renderer-test-bed-factory';\n\nexport function mergeRendererFactory<F extends RendererTestBedFactory<unknown>, TB>(factory: F, tb: TB & F): TB {\n mergeBaseFactory(factory, tb);\n\n tb.declare = (declarations: any) => {\n factory.declare(declarations);\n return tb;\n };\n return tb;\n}\n","import { Type } from '@angular/core';\nimport { Nullable } from '../shared.models';\n\ntype MetadataName =\n | 'Component'\n | 'Directive'\n | 'Injectable'\n | 'NgModule'\n | 'Pipe'\n\nexport function getAnnotation<T, A>(AnyCtor: Type<T>, metadataName: MetadataName): Nullable<A> {\n const annotations = (AnyCtor as any)['__annotations__'];\n if (!annotations) return null;\n\n for (let i = annotations.length - 1; i >= 0; i --) {\n const annotation = annotations[i];\n if (isSameMetadataName(annotation, metadataName)) return annotation;\n }\n return null;\n}\n\nfunction isSameMetadataName(annotation: any, metadataName: MetadataName): boolean {\n return Object.getPrototypeOf(annotation)['ngMetadataName'] === metadataName;\n}\n","import { Component, Type } from '@angular/core';\nimport { Nullable } from '../shared.models';\nimport { getAnnotation } from './annotation';\n\nexport function getComponentAnnotation<T>(ComponentCtor: Type<T>): Nullable<Component> {\n return getAnnotation(ComponentCtor, 'Component');\n}\n","interface CtorErrorOptions {\n name: string;\n type: string;\n testBedName: string;\n}\n\nexport function throwCtorError(options: CtorErrorOptions): never {\n const { name, type, testBedName } = options;\n throw new ReferenceError(`The provided \"${name}\" is not a ${type}. The ${testBedName} cannot be created.`);\n}\n","import { Component, Type } from '@angular/core';\nimport { getComponentAnnotation } from '../annotations/component-annotation';\nimport { throwCtorError } from '../errors/throw-ctor-error';\nimport { Nullable } from '../shared.models';\n\nexport function assertComponentCtor(ComponentCtor: Type<unknown>): void {\n const annotation: Nullable<Component> = getComponentAnnotation(ComponentCtor);\n if (!annotation)\n throwCtorError({ name: ComponentCtor.name ?? ComponentCtor, type: 'Component', testBedName: 'ComponentTestBed' });\n}\n","interface InstanceErrorOptions {\n name: string;\n}\n\nexport function throwInstanceError(options: InstanceErrorOptions): never {\n const { name } = options;\n throw new ReferenceError(`${name} instance is falsy. You need to set \\`autoCompile = true\\` (default) or set \\`beforeEach(() => tb.compile());\\` and \\`autoCompile = false\\` before running expectations.`);\n}\n","import { Type } from '@angular/core';\nimport { throwInstanceError } from '../errors/throw-instance-error';\n\nexport function assertInstance(instance: unknown, Ctor: Type<unknown> | AbstractType<unknown>): void {\n if (!(instance instanceof Ctor)) throwInstanceError({ name: Ctor.name });\n}\n\ntype AbstractType<T = any> = abstract new (...args: any[]) => T;\n","export function shouldCreate(factory: () => unknown): void {\n globalThis.it('should create', () => {\n expect(factory()).toBeTruthy();\n });\n}\n","import { MaybeArray } from '../shared.models';\n\nexport function makeArray<T>(itemS: MaybeArray<T>): T[] {\n return (Array.isArray(itemS)) ? itemS : [itemS];\n}\n","import { MaybeArray } from '../shared.models';\nimport { makeArray } from './array.util';\n\nexport function appendSet<T>(set: Set<T>, itemS: MaybeArray<T>): void {\n makeArray(itemS).forEach(v => set.add(v));\n}\n","import { ProviderToken, Type } from '@angular/core';\nimport { TestBed, TestBedStatic } from '@angular/core/testing';\nimport { assertInstance } from '../../assertions/assert-instance';\nimport { shouldCreate } from '../../expectations/should-create';\nimport { buildJasmineCallback } from '../../jasmine/jasmine-callback';\nimport { EnhancedJasmineCallback } from '../../jasmine/models/enhanced-jasmine-callback.model';\nimport { JasmineCallback } from '../../jasmine/models/jasmine-callback.model';\nimport { MaybeArray, NonEmptyString, PrettyMerge } from '../../shared.models';\nimport { BaseTools } from '../../tools/base/models/base-tools.model';\nimport { DeferredTools } from '../../tools/models/deferred-tools.model';\nimport { InjectionStore } from '../../tools/store/models/injected-store.model';\nimport { appendSet } from '../../utils/set.util';\nimport { AnyProvider, Importation } from '../models/metadata-type.models';\nimport { BaseTestBedOptions } from './models/base-test-bed-options.model';\n\nexport abstract class BaseTestBedFactory<\n DescribedType,\n Store extends InjectionStore = InjectionStore,\n Tools extends BaseTools = BaseTools\n> {\n\n protected constructor(\n protected described: Type<DescribedType>,\n options: BaseTestBedOptions,\n ) {\n const {\n imports = [],\n providers = [],\n autoCompile = true,\n checkCreate = true,\n } = options;\n\n this.imports = new Set(imports);\n this.providers = new Set(providers);\n\n if (autoCompile) this._compileEach();\n if (checkCreate) this._shouldCreate();\n }\n\n protected testBed: TestBedStatic = TestBed;\n\n private _instance: DescribedType = null!;\n\n protected get instance(): DescribedType {\n assertInstance(this._instance, this.described);\n return this._instance;\n }\n\n protected abstract deferredTools: DeferredTools<Tools>;\n\n protected injectedMap: Map<string, ProviderToken<any>> = new Map();\n\n protected imports: Set<Importation>;\n protected providers: Set<AnyProvider>;\n\n protected injectDescribed(): void {\n this._instance = this.testBed.inject(this.described);\n }\n\n /**\n * Imports one module or one standalone component / directive / pipe into the custom test bed.\n */\n public import(importation: Importation): this\n /**\n * Imports many modules or many standalone components / directives / pipes into the custom test bed.\n */\n public import(imports: Importation[]): this\n public import(oneOrManyImports: MaybeArray<Importation>): this {\n appendSet(this.imports, oneOrManyImports);\n return this;\n }\n\n /**\n * Adds one provider into the custom test bed.\n */\n public provide(provider: AnyProvider): this\n /**\n * Adds many providers into the custom test bed.\n */\n public provide(providers: AnyProvider[]): this\n public provide(oneOrManyProviders: MaybeArray<AnyProvider>): this {\n appendSet(this.providers, oneOrManyProviders);\n return this;\n }\n\n /**\n * Injects an instance by token into the custom test bed.\n *\n * Retrieve it into the tools `injected` by autocompletion.\n * @param name the key to access the instance.\n * @param token the provider token.\n */\n public inject<key extends string, T>(name: NonEmptyString<key>, token: ProviderToken<T>): BaseTestBedFactory<DescribedType, InjectionStore<PrettyMerge<Store['injected'] & { [k in key]: T }>>> {\n this.injectedMap.set(name, token);\n return this;\n }\n\n public _compileEach(): void {\n globalThis.beforeEach(() => this.compile());\n }\n\n /**\n * Manually compiles the custom test bed to make enhanced tools available.\n *\n * To be used when `autoCompile = false`.\n *\n * **To be called inside jasmine `beforeEach` callback.**\n */\n public async compile(): Promise<void> {\n this.testBed.configureTestingModule({\n imports: [...this.imports.values()],\n providers: [...this.providers.values()],\n });\n }\n\n /**\n * Sets up extra stuffs using the enhanced tools.\n *\n * **Works only for `beforeEach` and `afterEach`**.\n */\n public setup(action: EnhancedJasmineCallback<Tools>): JasmineCallback {\n return buildJasmineCallback({\n callback: action,\n deferredTools: this.deferredTools,\n });\n }\n\n public _shouldCreate(): void {\n shouldCreate(() => this.instance);\n }\n}\n","import { isStandalone, SchemaMetadata, Type } from '@angular/core';\nimport { ComponentFixture } from '@angular/core/testing';\nimport { provideNoopAnimations } from '@angular/platform-browser/animations';\nimport { assertInstance } from '../../assertions/assert-instance';\nimport { shouldCreate } from '../../expectations/should-create';\nimport { MaybeArray } from '../../shared.models';\nimport { BaseTools } from '../../tools/base/models/base-tools.model';\nimport { InjectionStore } from '../../tools/store/models/injected-store.model';\nimport { appendSet } from '../../utils/set.util';\nimport { BaseTestBedFactory } from '../base/base-test-bed-factory';\nimport { Declaration } from '../models/metadata-type.models';\nimport { RendererTestBedOptions } from './models/renderer-test-bed-options.model';\n\nexport abstract class RendererTestBedFactory<\n DescribedType,\n Store extends InjectionStore = InjectionStore,\n Tools extends BaseTools = BaseTools,\n HostType = DescribedType,\n> extends BaseTestBedFactory<DescribedType, Store, Tools> {\n\n protected constructor(\n described: Type<DescribedType>,\n private host: Type<HostType>,\n options: RendererTestBedOptions,\n ) {\n super(described, options);\n\n const {\n declarations = [],\n schemas = [],\n startDetectChanges = true,\n noopAnimations = true,\n noTemplate = false,\n } = options;\n\n this.startDetectChanges = startDetectChanges;\n this.noTemplate = noTemplate;\n\n this.declarations = new Set(declarations);\n this.schemas = new Set(schemas);\n\n if (noopAnimations) this.provide(provideNoopAnimations());\n\n (isStandalone(this.host))\n ? this.import(this.host)\n : this.declare(this.host);\n\n (isStandalone(this.described))\n ? this.import(this.described)\n : this.declare(this.described);\n }\n\n protected readonly startDetectChanges: boolean;\n protected readonly noTemplate: boolean;\n\n protected declarations: Set<Declaration>;\n protected schemas: Set<SchemaMetadata>;\n\n protected _fixture: ComponentFixture<HostType> = null!;\n\n protected get fixture(): ComponentFixture<HostType> {\n assertInstance(this._fixture, ComponentFixture);\n return this._fixture;\n }\n\n protected createHostFixture(): void {\n this._fixture = this.testBed.createComponent(this.host);\n }\n\n /**\n * Declares one non-standalone component, directive or pipe into the custom test bed.\n */\n public declare(declaration: Declaration): this\n /**\n * Declares many non-standalone components, directives and pipes into the custom test bed.\n */\n public declare(declarations: Declaration[]): this\n public declare(oneOrManyDeclarations: MaybeArray<Declaration>): this {\n appendSet(this.declarations, oneOrManyDeclarations);\n return this;\n }\n\n public override async compile(): Promise<void> {\n await super.compile();\n this.testBed.configureTestingModule({\n declarations: [...this.declarations.values()],\n schemas: [...this.schemas.values()],\n });\n if (this.noTemplate) this.testBed.overrideTemplateUsingTestingModule(this.host, '');\n await this.testBed.compileComponents();\n }\n\n public override _shouldCreate(): void {\n shouldCreate(() => this.fixture.componentInstance);\n }\n}\n","import { HttpFeature, provideHttpClient } from '@angular/common/http';\nimport { provideHttpClientTesting } from '@angular/common/http/testing';\nimport { AnyProvider } from '../../test-beds/models/metadata-type.models';\n\nexport function httpProviders(...features: HttpFeature<any>[]): AnyProvider[] {\n return [\n provideHttpClient(...features),\n provideHttpClientTesting(),\n ];\n}\n\nexport const HTTP_PROVIDERS: AnyProvider[] = httpProviders();\n","import { Injector, ProviderToken } from '@angular/core';\nimport { InjectionStore } from './models/injected-store.model';\n\nexport function buildInjected(injector: Injector, injectedMap: Map<string, ProviderToken<any>>): InjectionStore['injected'] {\n const injected: InjectionStore<any>['injected'] = {};\n for (const [name, token] of injectedMap.entries()) {\n injected[name] = injector.get(token);\n }\n return injected;\n}\n","import { Subject, Subscription } from 'rxjs';\nimport { MethodsOf } from '../../../shared.models';\n\ntype Remindable =\n | Subscription\n | Subject<any>\n\nexport class RxBox {\n\n private subs: Subscription[] = [];\n private subjects: Subject<any>[] = [];\n\n public set remind(value: Remindable) {\n (value instanceof Subscription)\n ? this.subs.push(value)\n : this.subjects.push(value);\n }\n\n public bigRemind(values: Remindable[]): void {\n values.forEach(v => (this.remind = v));\n }\n\n private cleanAll(): void {\n this.unsubscribe();\n this.complete();\n }\n\n private unsubscribe(): void {\n this.clean(this.subs, 'unsubscribe');\n }\n\n private complete(): void {\n this.clean(this.subjects, 'complete');\n }\n\n private clean<T>(array: T[], cleanFnKey: keyof MethodsOf<T>): void {\n array.forEach(v => (v[cleanFnKey] as () => void)());\n array.length = 0;\n }\n}\n","import { Injector } from '@angular/core';\nimport { BaseTestBedFactory } from '../../test-beds/base/base-test-bed-factory';\nimport { buildInjected } from '../store/injected';\nimport { InjectionStore } from '../store/models/injected-store.model';\nimport { BaseTools } from './models/base-tools.model';\nimport { RxBox } from './rx/rx-box';\n\ninterface BaseToolsBuilderOptions {\n thisInjector?: Injector;\n}\n\nexport function buildBaseTools<T>(factory: BaseTestBedFactory<T>, options?: BaseToolsBuilderOptions): BaseTools {\n const injector: Injector = options?.thisInjector ?? factory['testBed'].inject(Injector);\n const injected: InjectionStore['injected'] = buildInjected(injector, factory['injectedMap']);\n const rx = new RxBox();\n\n return { injected, injector, rx };\n}\n","import { HttpTestingController } from '@angular/common/http/testing';\nimport { ErrorResponseConfig } from './models/error-response-config.model';\n\nexport function emitFakeErrorResponse(httpController: HttpTestingController, config: ErrorResponseConfig): void {\n const { url, method, status, statusText = 'Error' } = config;\n const error = new ProgressEvent(statusText);\n\n httpController\n .expectOne({ url, method })\n .error(error, { status, statusText });\n}\n","import { HttpTestingController } from '@angular/common/http/testing';\nimport { BodyType, SuccessResponseConfig } from './models/success-response-config.model';\n\nexport function emitFakeSuccessResponse<T extends BodyType>(httpController: HttpTestingController, config: SuccessResponseConfig<T>): void {\n const { url, method, body, status, headers, statusText } = config;\n\n httpController\n .expectOne({ url, method })\n .flush(body, { status, headers, statusText });\n}\n","import { HttpClient } from '@angular/common/http';\nimport { HttpTestingController } from '@angular/common/http/testing';\nimport { Injector } from '@angular/core';\nimport { Unusable } from '../../shared.models';\nimport { HttpOptions } from './models/http-options.model';\nimport { HttpTools } from './models/http-tools.model';\nimport { emitFakeErrorResponse } from './utils/emit-error-response';\nimport { emitFakeSuccessResponse } from './utils/emit-success-response';\n\nexport function buildHttpTools(injector: Injector, options: HttpOptions): HttpTools {\n if (!options.httpTesting) return unusableHttpTools();\n\n const client = injector.get(HttpClient);\n const controller = injector.get(HttpTestingController);\n\n return {\n client,\n controller,\n emitSuccessResponse: (config) => emitFakeSuccessResponse(controller, config),\n emitErrorResponse: (config) => emitFakeErrorResponse(controller, config),\n };\n}\n\nfunction unusableHttpTools(): Unusable<HttpTools> {\n return {\n get client() {return throwDisabledHttpTesting('client');},\n get controller() {return throwDisabledHttpTesting('controller');},\n emitSuccessResponse: () => throwDisabledHttpTesting('emitSuccessResponse'),\n emitErrorResponse: () => throwDisabledHttpTesting('emitErrorResponse'),\n };\n}\n\nfunction throwDisabledHttpTesting(key: keyof HttpTools): never {\n throw new ReferenceError(`Cannot use \\`http.${key}\\` because HttpTools is not initialized. You need to set \\`httpTesting:true\\` into the test bed options.`);\n}\n","import { Type } from '@angular/core';\n\ntype Quantifier =\n | 'one'\n | 'many'\n\nexport function throwCannotFind(selectorOrDirective: string | Type<any>, quantifier: Quantifier = 'one'): never {\n const input: string = (typeof selectorOrDirective === 'string')\n ? `selector \"${selectorOrDirective}\"`\n : `directive \"${selectorOrDirective.name}\"`;\n\n throw new Error(`Cannot find ${quantifier} DebugElement with : ${input}.`);\n}\n","import { DebugElement, Type } from '@angular/core';\nimport { ComponentFixture } from '@angular/core/testing';\nimport { By } from '@angular/platform-browser';\nimport { Nullable } from '../../../../shared.models';\nimport { throwCannotFind } from './cannot-find';\n\nexport function findDebugElement(fixture: ComponentFixture<any>, selector: string): DebugElement\nexport function findDebugElement(fixture: ComponentFixture<any>, directive: Type<any>): DebugElement\nexport function findDebugElement(fixture: ComponentFixture<any>, selectorOrDirective: string | Type<any>): DebugElement\nexport function findDebugElement(fixture: ComponentFixture<any>, selectorOrDirective: string | Type<any>): DebugElement {\n const element: Nullable<DebugElement> = (typeof selectorOrDirective === 'string')\n ? fixture.debugElement.query(By.css(selectorOrDirective))\n : fixture.debugElement.query(By.directive(selectorOrDirective));\n\n if (!element) throwCannotFind(selectorOrDirective);\n\n return element;\n}\n","import { Type } from '@angular/core';\nimport { ComponentFixture } from '@angular/core/testing';\nimport { findDebugElement } from '../../query/utils/find-debug-element';\n\nexport function emitEvent(fixture: ComponentFixture<any>, selectorOrDirective: string | Type<any>, name: string, value?: any): void {\n findDebugElement(fixture, selectorOrDirective)\n .triggerEventHandler(name, value);\n}\n","import { Type } from '@angular/core';\nimport { ComponentFixture } from '@angular/core/testing';\nimport { emitEvent } from './event';\n\nexport function emitOutput(fixture: ComponentFixture<any>, selector: string, name: string, $event?: any): void\nexport function emitOutput(fixture: ComponentFixture<any>, directive: Type<any>, name: string, $event?: any): void\nexport function emitOutput(fixture: ComponentFixture<any>, selectorOrDirective: string | Type<any>, name: string, $event?: any): void\nexport function emitOutput(fixture: ComponentFixture<any>, selectorOrDirective: string | Type<any>, name: string, $event?: any): void {\n emitEvent(fixture, selectorOrDirective, name, $event);\n}\n","import { Type } from '@angular/core';\nimport { ComponentFixture } from '@angular/core/testing';\nimport { emitOutput } from './output';\n\nexport function click(fixture: ComponentFixture<any>, selector: string): void\nexport function click(fixture: ComponentFixture<any>, directive: Type<any>): void\nexport function click(fixture: ComponentFixture<any>, selectorOrDirective: string | Type<any>): void\nexport function click(fixture: ComponentFixture<any>, selectorOrDirective: string | Type<any>): void {\n emitOutput(fixture, selectorOrDirective, 'click');\n}\n","import { ComponentFixture } from '@angular/core/testing';\nimport { ActionTools } from './models/action-tools.model';\nimport { click } from './utils/click';\nimport { emitOutput } from './utils/output';\n\nexport function buildActionTools(fixture: ComponentFixture<unknown>): ActionTools {\n return {\n click: (input) => click(fixture, input),\n emitOutput: (directive, name, val) => emitOutput(fixture, directive, name, val),\n // setInput: (name: string, $value: any) => {}\n }\n}\n","import { DebugElement, Type } from '@angular/core';\nimport { ComponentFixture } from '@angular/core/testing';\nimport { By } from '@angular/platform-browser';\nimport { throwCannotFind } from './cannot-find';\n\nexport function findAllDebugElements(fixture: ComponentFixture<any>, selector: string): DebugElement[]\nexport function findAllDebugElements(fixture: ComponentFixture<any>, directive: Type<any>): DebugElement[]\nexport function findAllDebugElements(fixture: ComponentFixture<any>, selectorOrDirective: string | Type<any>): DebugElement[]\nexport function findAllDebugElements(fixture: ComponentFixture<any>, selectorOrDirective: string | Type<any>): DebugElement[] {\n const debugs: DebugElement[] = (typeof selectorOrDirective === 'string')\n ? fixture.debugElement.queryAll(By.css(selectorOrDirective))\n : fixture.debugElement.queryAll(By.directive(selectorOrDirective));\n\n if (debugs.length === 0) throwCannotFind(selectorOrDirective, 'many');\n\n return debugs;\n}\n","import { Type } from '@angular/core';\nimport { ComponentFixture } from '@angular/core/testing';\nimport { findAllDebugElements } from './find-all-debug-elements';\n\nexport function findAllComponents<T>(fixture: ComponentFixture<any>, selector: string): T[]\nexport function findAllComponents<T>(fixture: ComponentFixture<any>, directive: Type<T>): T[]\nexport function findAllComponents<T>(fixture: ComponentFixture<any>, selectorOrDirective: string | Type<T>): T[]\nexport function findAllComponents<T>(fixture: ComponentFixture<any>, selectorOrDirective: string | Type<T>): T[] {\n return findAllDebugElements(fixture, selectorOrDirective).map(e => e.componentInstance);\n}\n","import { Type } from '@angular/core';\nimport { ComponentFixture } from '@angular/core/testing';\nimport { findAllDebugElements } from './find-all-debug-elements';\n\nexport function findAllElements<T extends HTMLElement = HTMLElement>(fixture: ComponentFixture<any>, selector: string): T[]\nexport function findAllElements<T extends HTMLElement = HTMLElement>(fixture: ComponentFixture<any>, directive: Type<any>): T[]\nexport function findAllElements<T extends HTMLElement = HTMLElement>(fixture: ComponentFixture<any>, selectorOrDirective: string | Type<any>): T[]\nexport function findAllElements<T extends HTMLElement = HTMLElement>(fixture: ComponentFixture<any>, selectorOrDirective: string | Type<any>): T[] {\n return findAllDebugElements(fixture, selectorOrDirective).map(e => e.nativeElement);\n}\n","import { Type } from '@angular/core';\nimport { ComponentFixture } from '@angular/core/testing';\nimport { findDebugElement } from './find-debug-element';\n\nexport function findComponent<T>(fixture: ComponentFixture<any>, selector: string): T\nexport function findComponent<T>(fixture: ComponentFixture<any>, directive: Type<T>): T\nexport function findComponent<T>(fixture: ComponentFixture<any>, selectorOrDirective: string | Type<T>): T\nexport function findComponent<T>(fixture: ComponentFixture<any>, selectorOrDirective: string | Type<T>): T {\n return findDebugElement(fixture, selectorOrDirective).componentInstance;\n}\n","import { Type } from '@angular/core';\nimport { ComponentFixture } from '@angular/core/testing';\nimport { findDebugElement } from './find-debug-element';\n\nexport function findElement<T extends HTMLElement = HTMLElement>(fixture: ComponentFixture<any>, selector: string): T\nexport function findElement<T extends HTMLElement = HTMLElement>(fixture: ComponentFixture<any>, directive: Type<any>): T\nexport function findElement<T extends HTMLElement = HTMLElement>(fixture: ComponentFixture<any>, selectorOrDirective: string | Type<any>): T\nexport function findElement<T extends HTMLElement = HTMLElement>(fixture: ComponentFixture<any>, selectorOrDirective: string | Type<any>): T {\n return findDebugElement(fixture, selectorOrDirective).nativeElement;\n}\n","import { ComponentFixture } from '@angular/core/testing';\nimport { QueryTools } from './models/query-tools.model';\nimport { findAllComponents } from './utils/find-all-components';\nimport { findAllDebugElements } from './utils/find-all-debug-elements';\nimport { findAllElements } from './utils/find-all-elements';\nimport { findComponent } from './utils/find-component';\nimport { findDebugElement } from './utils/find-debug-element';\nimport { findElement } from './utils/find-element';\n\nexport function buildQueryTools(fixture: ComponentFixture<unknown>): QueryTools {\n return {\n findComponent: (input) => findComponent(fixture, input),\n findAllComponents: (input) => findAllComponents(fixture, input),\n findElement: (input) => findElement(fixture, input),\n findAllElements: (input) => findAllElements(fixture, input),\n findDebugElement: (input) => findDebugElement(fixture, input),\n findAllDebugElements: (input) => findAllDebugElements(fixture, input),\n };\n}\n","import { ComponentFixture } from '@angular/core/testing';\nimport { RendererTestBedFactory } from '../../test-beds/renderer/renderer-test-bed-factory';\nimport { buildActionTools } from './action/action-tools';\nimport { ActionTools } from './action/models/action-tools.model';\nimport { RendererTools } from './models/renderer-tools.model';\nimport { QueryTools } from './query/models/query-tools.model';\nimport { buildQueryTools } from './query/query-tools';\n\nexport function buildRendererTools<T>(factory: RendererTestBedFactory<unknown, any, any, T>): RendererTools<T> {\n const fixture: ComponentFixture<T> = factory['fixture'];\n\n const host: T = fixture.componentInstance;\n const element: HTMLElement | undefined = fixture.debugElement.children.at(0)?.nativeElement;\n\n const query: QueryTools = buildQueryTools(fixture);\n const action: ActionTools = buildActionTools(fixture);\n\n return { action, element, fixture, host, query };\n}\n","import { buildBaseTools } from '../../common/tools/base/base-tools';\nimport { buildHttpTools } from '../../common/tools/http/http-tools';\nimport { HttpOptions } from '../../common/tools/http/models/http-options.model';\nimport { HttpTools } from '../../common/tools/http/models/http-tools.model';\nimport { buildRendererTools } from '../../common/tools/renderer/renderer-tools';\nimport { ComponentTestBedFactory } from '../component-test-bed-factory';\nimport { ComponentTools } from './models';\n\nexport function buildComponentTools<T>(factory: ComponentTestBedFactory<T>, httpOptions: HttpOptions): ComponentTools<T> {\n const { action, element, fixture, host: component, query } = buildRendererTools(factory);\n const { injected, injector, rx } = buildBaseTools(factory, { thisInjector: fixture.debugElement.injector });\n const http: HttpTools = buildHttpTools(injector, httpOptions);\n\n return { action, component, element, fixture, http, injected, injector, query, rx };\n}\n","import { Type } from '@angular/core';\nimport { assertComponentCtor } from '../common/assertions/assert-component-ctor';\nimport { RendererTestBedFactory } from '../common/test-beds/renderer/renderer-test-bed-factory';\nimport { HTTP_PROVIDERS } from '../common/tools/http/http-providers';\nimport { HttpOptions } from '../common/tools/http/models/http-options.model';\nimport { InjectionStore } from '../common/tools/store/models/injected-store.model';\nimport { ComponentTestBedOptions } from './models';\nimport { ComponentTools } from './tools';\nimport { buildComponentTools } from './tools/component-tools';\n\nexport class ComponentTestBedFactory<\n ComponentType,\n Store extends InjectionStore = InjectionStore\n> extends RendererTestBedFactory<ComponentType, Store, ComponentTools<ComponentType, Store['injected']>> {\n\n public constructor(\n rootComponent: Type<ComponentType>,\n options: ComponentTestBedOptions,\n ) {\n assertComponentCtor(rootComponent);\n super(rootComponent, rootComponent, options);\n\n const {\n httpTesting = false,\n verifyHttp = true,\n } = options;\n\n if (httpTesting) this.provide(HTTP_PROVIDERS);\n\n this.httpOptions = { httpTesting, verifyHttp };\n }\n\n private readonly httpOptions: Required<HttpOptions>;\n\n protected override deferredTools = () => buildComponentTools(this, this.httpOptions);\n\n public override async compile(): Promise<void> {\n await super.compile();\n this.createHostFixture();\n }\n}\n","import { Type } from '@angular/core';\nimport { buildJasmineCallback } from '../common/jasmine/jasmine-callback';\nimport { mergeRendererFactory } from '../common/test-beds/renderer/merge-renderer-factory';\nimport { ComponentTestBedFactory } from './component-test-bed-factory';\nimport { ComponentTestBed, ComponentTestBedOptions } from './models';\n\n/**\n * Creates a new `ComponentTestBed` to configure the custom test bed and wrap the assertion test.\n * @param rootComponent - The described Component.\n * @param options\n */\nexport function componentTestBed<T>(rootComponent: Type<T>, options: ComponentTestBedOptions = {}): ComponentTestBed<T> {\n const factory = new ComponentTestBedFactory(rootComponent, options);\n\n const {\n httpTesting,\n verifyHttp: defaultVerifyHttp,\n } = factory['httpOptions'];\n\n const defaultStartDetectChanges = factory['startDetectChanges'];\n const noTemplate = factory['noTemplate'];\n\n const tb: ComponentTestBed<T> = ((assertion, opts = {}) => {\n const {\n startDetectChanges = defaultStartDetectChanges,\n verifyHttp = defaultVerifyHttp,\n } = opts;\n\n return buildJasmineCallback({\n callback: assertion,\n deferredTools: factory['deferredTools'],\n preTest: (tools) => {\n if (!noTemplate && startDetectChanges) tools.fixture.detectChanges();\n },\n postTest: (tools) => {\n if (httpTesting && verifyHttp) tools.http.controller.verify();\n tools.rx['cleanAll']();\n },\n });\n }) as ComponentTestBed<T>;\n\n return mergeRendererFactory(factory, tb);\n}\n\n/**\n * Only invokes the \"should create\" test.\n *\n * To be used when there are no noticeable or relevant tests to be performed on this component.\n *\n * The usage of this function and `componentTestBed` function must be mutually exclusive.\n *\n * @param rootComponent - The described Component.\n * @param options\n */\nexport function itShouldCreateComponent<T>(rootComponent: Type<T>, options?: itShouldCreateComponentOptions): void {\n componentTestBed(rootComponent, options);\n}\n\ntype itShouldCreateComponentOptions = Pick<ComponentTestBedOptions,\n | 'imports'\n | 'providers'\n | 'declarations'\n | 'schemas'\n>\n","import { Directive, Type } from '@angular/core';\nimport { Nullable } from '../shared.models';\nimport { getAnnotation } from './annotation';\n\nexport function getDirectiveAnnotation<T>(DirectiveCtor: Type<T>): Nullable<Directive> {\n return getAnnotation(DirectiveCtor, 'Directive');\n}\n","import { Directive, Type } from '@angular/core';\nimport { getDirectiveAnnotation } from '../annotations/directive-annotation';\nimport { throwCtorError } from '../errors/throw-ctor-error';\nimport { Nullable } from '../shared.models';\n\nexport function assertDirectiveCtor(DirectiveCtor: Type<unknown>): void {\n const annotation: Nullable<Directive> = getDirectiveAnnotation(DirectiveCtor);\n if (!annotation)\n throwCtorError({ name: DirectiveCtor.name ?? DirectiveCtor, type: 'Directive', testBedName: 'DirectiveTestBed' });\n}\n","import { InjectionToken } from '@angular/core';\nimport { ComponentFixture } from '@angular/core/testing';\n\nexport const HOST_FIXTURE = new InjectionToken<ComponentFixture<unknown>>('HOST_FIXTURE');\n","import { ElementRef, Inject, Injectable } from '@angular/core';\nimport { ComponentFixture } from '@angular/core/testing';\nimport { HOST_FIXTURE } from './host-fixture.token';\n\n@Injectable()\nexport class HostElementRef extends ElementRef {\n\n public constructor(\n @Inject(HOST_FIXTURE) fixture: ComponentFixture<unknown>,\n ) {\n // Use `innerHTML` to remove the fixture element wrapper (<div id=\"rootXX\" ng-version=\"X.X.X\">..</div>)\n super(fixture.nativeElement.innerHTML);\n }\n}\n","import { buildBaseTools } from '../../common/tools/base/base-tools';\nimport { buildRendererTools } from '../../common/tools/renderer/renderer-tools';\nimport { DirectiveTestBedFactory } from '../directive-test-bed-factory';\nimport { DirectiveTools } from './models';\n\nexport function buildDirectiveTools<T, H>(factory: DirectiveTestBedFactory<T, H>): DirectiveTools<T, H> {\n const directive: T = factory['instance'];\n\n const { action, element, fixture, host, query } = buildRendererTools(factory);\n const { injected, injector, rx } = buildBaseTools(factory, { thisInjector: fixture.debugElement.injector });\n\n return { action, directive, element, fixture, host, injected, injector, query, rx };\n}\n","import { ElementRef, Type, ViewContainerRef } from '@angular/core';\nimport { assertDirectiveCtor } from '../common/assertions/assert-directive-ctor';\nimport { RendererTestBedFactory } from '../common/test-beds/renderer/renderer-test-bed-factory';\nimport { InjectionStore } from '../common/tools/store/models/injected-store.model';\nimport { HostElementRef } from './host/host-element-ref';\nimport { HOST_FIXTURE } from './host/host-fixture.token';\nimport { DirectiveTestBedOptions } from './models';\nimport { DirectiveTools } from './tools';\nimport { buildDirectiveTools } from './tools/directive-tools';\n\nexport class DirectiveTestBedFactory<\n DirectiveType,\n HostType,\n Store extends InjectionStore = InjectionStore\n> extends RendererTestBedFactory<DirectiveType, Store, DirectiveTools<DirectiveType, HostType, Store['injected']>, HostType> {\n\n public constructor(\n rootDirective: Type<DirectiveType>,\n hostComponent: Type<HostType>,\n options: DirectiveTestBedOptions,\n ) {\n assertDirectiveCtor(rootDirective);\n super(rootDirective, hostComponent, options);\n\n this.provide([\n rootDirective,\n { provide: HOST_FIXTURE, useFactory: () => this.fixture },\n { provide: ElementRef, useClass: HostElementRef },\n ViewContainerRef,\n ]);\n }\n\n protected override deferredTools = () => buildDirectiveTools(this);\n\n public override async compile(): Promise<void> {\n await super.compile();\n this.createHostFixture();\n this.injectDescribed();\n }\n}\n","import { Component, Type } from '@angular/core';\nimport { buildJasmineCallback } from '../common/jasmine/jasmine-callback';\nimport { mergeRendererFactory } from '../common/test-beds/renderer/merge-renderer-factory';\nimport { DirectiveTestBedFactory } from './directive-test-bed-factory';\nimport { DirectiveTestBed, DirectiveTestBedOptions } from './models';\n\n/**\n * Creates a new `DirectiveTestBed` to configure the custom test bed and wrap the assertion test.\n * @param rootDirective - The described Directive.\n * @param hostComponent - The host component on which the directive is tested.\n * @param options\n */\nexport function directiveTestBed<T, H>(rootDirective: Type<T>, hostComponent: Type<H>, options: DirectiveTestBedOptions = {}): DirectiveTestBed<T, H> {\n const factory = new DirectiveTestBedFactory(rootDirective, hostComponent, options);\n\n const defaultStartDetectChanges = factory['startDetectChanges'];\n const noTemplate = factory['noTemplate'];\n\n const tb: DirectiveTestBed<T, H> = ((assertion, opts = {}) => {\n const { startDetectChanges = defaultStartDetectChanges } = opts;\n\n return buildJasmineCallback({\n callback: assertion,\n deferredTools: factory['deferredTools'],\n preTest: (tools) => {\n if (!noTemplate && startDetectChanges) tools.fixture.detectChanges();\n },\n postTest: (tools) => {\n tools.rx['cleanAll']();\n },\n });\n }) as DirectiveTestBed<T, H>;\n\n return mergeRendererFactory(factory, tb);\n}\n\n/**\n * Only invokes the \"should create\" test.\n *\n * To be used when there are no noticeable or relevant tests to be performed on this directive.\n *\n * The usage of this function and `directiveTestBed` function must be mutually exclusive.\n *\n * @param rootDirective - The described Directive.\n * @param options\n */\nexport function itShouldCreateDirective<T>(rootDirective: Type<T>, options?: itShouldCreateDirectiveOptions): void {\n @Component({ template: '', standalone: true, selector: 'host-component:not(div)' })\n class HostComponent {}\n\n directiveTestBed(rootDirective, HostComponent, options);\n}\n\ntype itShouldCreateDirectiveOptions = Pick<DirectiveTestBedOptions,\n | 'imports'\n | 'providers'\n | 'declarations'\n | 'schemas'\n>\n","import { Injectable, Type } from '@angular/core';\nimport { Nullable } from '../shared.models';\nimport { getAnnotation } from './annotation';\n\nexport function getInjectableAnnotation<T>(InjectableCtor: Type<T>): Nullable<Injectable> {\n return getAnnotation(InjectableCtor, 'Injectable');\n}\n","import { Injectable, Type } from '@angular/core';\nimport { getInjectableAnnotation } from '../annotations/injectable-annotation';\nimport { throwCtorError } from '../errors/throw-ctor-error';\nimport { Nullable } from '../shared.models';\n\nexport function assertServiceCtor(ServiceCtor: Type<unknown>): void {\n const annotation: Nullable<Injectable> = getInjectableAnnotation(ServiceCtor);\n if (!annotation)\n throwCtorError({ name: ServiceCtor.name ?? ServiceCtor, type: 'Injectable Service', testBedName: 'ServiceTestBed' });\n}\n","import { buildBaseTools } from '../../common/tools/base/base-tools';\nimport { buildHttpTools } from '../../common/tools/http/http-tools';\nimport { HttpOptions } from '../../common/tools/http/models/http-options.model';\nimport { HttpTools } from '../../common/tools/http/models/http-tools.model';\nimport { ServiceTestBedFactory } from '../service-test-bed-factory';\nimport { ServiceTools } from './models';\n\nexport function buildServiceTools<T>(factory: ServiceTestBedFactory<T>, httpOptions: HttpOptions): ServiceTools<T> {\n const service: T = factory['instance'];\n const { injected, injector, rx } = buildBaseTools(factory);\n const http: HttpTools = buildHttpTools(injector, httpOptions);\n\n return { http, injected, injector, rx, service };\n}\n","import { Type } from '@angular/core';\nimport { assertServiceCtor } from '../common/assertions/assert-service-ctor';\nimport { BaseTestBedFactory } from '../common/test-beds/base/base-test-bed-factory';\nimport { HTT