@nativescript/angular
Advanced tools
| declare const nsNgPolyfills = true; | ||
| export { nsNgPolyfills }; |
| import { LayoutBase } from '@nativescript/core'; | ||
| import { TestComponentRenderer, ComponentFixture } from '@angular/core/testing'; | ||
| import * as i0 from '@angular/core'; | ||
| import { Provider, Type } from '@angular/core'; | ||
| import * as i1 from '@nativescript/angular'; | ||
| /** | ||
| * Get a reference to the fixtures container. | ||
| */ | ||
| declare function testingRootView(): LayoutBase; | ||
| /** | ||
| * A NativeScript based implementation of the TestComponentRenderer. | ||
| */ | ||
| declare class NativeScriptTestComponentRenderer extends TestComponentRenderer { | ||
| insertRootElement(rootElId: string): void; | ||
| static ɵfac: i0.ɵɵFactoryDeclaration<NativeScriptTestComponentRenderer, never>; | ||
| static ɵprov: i0.ɵɵInjectableDeclaration<NativeScriptTestComponentRenderer>; | ||
| } | ||
| /** | ||
| * Providers array is exported for cases where a custom module has to be constructed | ||
| * to test a particular piece of code. This can happen, for example, if you are trying | ||
| * to test dynamic component loading and need to specify an entryComponent for the testing | ||
| * module. | ||
| */ | ||
| declare const NATIVESCRIPT_TESTING_PROVIDERS: Provider[]; | ||
| /** | ||
| * NativeScript testing support module. Enables use of TestBed for angular components, directives, | ||
| * pipes, and services. | ||
| */ | ||
| declare class NativeScriptTestingModule { | ||
| static ɵfac: i0.ɵɵFactoryDeclaration<NativeScriptTestingModule, never>; | ||
| static ɵmod: i0.ɵɵNgModuleDeclaration<NativeScriptTestingModule, never, never, [typeof i1.NativeScriptModule]>; | ||
| static ɵinj: i0.ɵɵInjectorDeclaration<NativeScriptTestingModule>; | ||
| } | ||
| /** | ||
| * Return a promise that resolves after (durationMs) milliseconds | ||
| */ | ||
| declare function promiseWait(durationMs: number): () => Promise<void>; | ||
| /** | ||
| * Perform basic TestBed environment initialization. Call this once in the main entry point to your tests. | ||
| * @deprecated | ||
| */ | ||
| declare function nsTestBedInit(): void; | ||
| /** | ||
| * Helper for configuring a TestBed instance for rendering components for test. Ideally this | ||
| * would not be needed, and in truth it's just a wrapper to eliminate some boilerplate. It | ||
| * exists because when you need to specify `entryComponents` for a test the setup becomes quite | ||
| * a bit more complex than if you're just doing a basic component test. | ||
| * | ||
| * More about entryComponents complexity: https://github.com/angular/angular/issues/12079 | ||
| * | ||
| * Use: | ||
| * ``` | ||
| * beforeEach(nsTestBedBeforeEach([MyComponent,MyFailComponent])); | ||
| * ``` | ||
| * | ||
| * **NOTE*** Remember to pair with {@see nsTestBedAfterEach} | ||
| * | ||
| * @deprecated | ||
| * @param components Any components that you will create during the test | ||
| * @param providers Any services your tests depend on | ||
| * @param imports Any module imports your tests depend on | ||
| * @param entryComponents Any entry components that your tests depend on | ||
| */ | ||
| declare function nsTestBedBeforeEach(components: any[], providers?: any[], imports?: any[], entryComponents?: any[]): (done: any) => void; | ||
| /** | ||
| * Helper for a basic component TestBed clean up. | ||
| * @param resetEnv When true the testing environment will be reset | ||
| * @param resetFn When resetting the environment, use this init function | ||
| * @deprecated | ||
| */ | ||
| declare function nsTestBedAfterEach(resetEnv?: boolean, resetFn?: typeof nsTestBedInit): () => void; | ||
| /** | ||
| * Render a component using the TestBed helper, and return a promise that resolves when the | ||
| * ComponentFixture is fully initialized. | ||
| * @deprecated | ||
| */ | ||
| declare function nsTestBedRender<T>(componentType: Type<T>): Promise<ComponentFixture<T>>; | ||
| export { NATIVESCRIPT_TESTING_PROVIDERS, NativeScriptTestComponentRenderer, NativeScriptTestingModule, nsTestBedAfterEach, nsTestBedBeforeEach, nsTestBedInit, nsTestBedRender, promiseWait, testingRootView }; |
Sorry, the diff of this file is too big to display
@@ -1,1 +0,1 @@ | ||
| {"version":3,"file":"nativescript-angular-polyfills.mjs","sources":["../../../../packages/angular/polyfills/src/index.ts","../../../../packages/angular/polyfills/src/nativescript-angular-polyfills.ts"],"sourcesContent":["import { AbortController, AbortSignal } from '@nativescript/core/abortcontroller';\nexport const nsNgPolyfills = true;\n\nglobal.performance ??= {} as unknown as Performance;\n\nfunction getPerformanceObject() {\n const loadTime = Date.now();\n const performance: Partial<Performance> = {\n timeOrigin: loadTime,\n now() {\n return Date.now() - loadTime;\n },\n mark(name: string, options: PerformanceMarkOptions) {\n return {\n detail: options?.detail,\n duration: 0,\n entryType: 'mark',\n name,\n startTime: options?.startTime ?? Date.now() - loadTime,\n toJSON: () => {\n ('');\n },\n };\n },\n };\n return performance;\n}\n\nconst polyfilledPerformance = getPerformanceObject();\n\nfor (const key in polyfilledPerformance) {\n global.performance[key] ??= polyfilledPerformance[key];\n}\n\nif (typeof queueMicrotask === 'undefined') {\n global.queueMicrotask = (cb) => Promise.resolve().then(cb);\n}\n\nif (typeof global.AbortController === 'undefined') {\n // @ts-expect-error handling global namespace\n global.AbortController = AbortController;\n}\n\nif (typeof global.AbortSignal === 'undefined') {\n // @ts-expect-error handling global namespace\n global.AbortSignal = AbortSignal;\n}\n\nif (typeof queueMicrotask === 'undefined') {\n global.queueMicrotask = (cb) => Promise.resolve().then(cb);\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;AACO,MAAM,aAAa,GAAG;AAE7B,MAAM,CAAC,WAAW,KAAK,EAA4B;AAEnD,SAAS,oBAAoB,GAAA;AAC3B,IAAA,MAAM,QAAQ,GAAG,IAAI,CAAC,GAAG,EAAE;AAC3B,IAAA,MAAM,WAAW,GAAyB;AACxC,QAAA,UAAU,EAAE,QAAQ;QACpB,GAAG,GAAA;AACD,YAAA,OAAO,IAAI,CAAC,GAAG,EAAE,GAAG,QAAQ;SAC7B;QACD,IAAI,CAAC,IAAY,EAAE,OAA+B,EAAA;YAChD,OAAO;gBACL,MAAM,EAAE,OAAO,EAAE,MAAM;AACvB,gBAAA,QAAQ,EAAE,CAAC;AACX,gBAAA,SAAS,EAAE,MAAM;gBACjB,IAAI;gBACJ,SAAS,EAAE,OAAO,EAAE,SAAS,IAAI,IAAI,CAAC,GAAG,EAAE,GAAG,QAAQ;gBACtD,MAAM,EAAE,MAAK;oBACX,CAAC,EAAE;iBACJ;aACF;SACF;KACF;AACD,IAAA,OAAO,WAAW;AACpB;AAEA,MAAM,qBAAqB,GAAG,oBAAoB,EAAE;AAEpD,KAAK,MAAM,GAAG,IAAI,qBAAqB,EAAE;IACvC,MAAM,CAAC,WAAW,CAAC,GAAG,CAAC,KAAK,qBAAqB,CAAC,GAAG,CAAC;AACxD;AAEA,IAAI,OAAO,cAAc,KAAK,WAAW,EAAE;AACzC,IAAA,MAAM,CAAC,cAAc,GAAG,CAAC,EAAE,KAAK,OAAO,CAAC,OAAO,EAAE,CAAC,IAAI,CAAC,EAAE,CAAC;AAC5D;AAEA,IAAI,OAAO,MAAM,CAAC,eAAe,KAAK,WAAW,EAAE;;AAEjD,IAAA,MAAM,CAAC,eAAe,GAAG,eAAe;AAC1C;AAEA,IAAI,OAAO,MAAM,CAAC,WAAW,KAAK,WAAW,EAAE;;AAE7C,IAAA,MAAM,CAAC,WAAW,GAAG,WAAW;AAClC;AAEA,IAAI,OAAO,cAAc,KAAK,WAAW,EAAE;AACzC,IAAA,MAAM,CAAC,cAAc,GAAG,CAAC,EAAE,KAAK,OAAO,CAAC,OAAO,EAAE,CAAC,IAAI,CAAC,EAAE,CAAC;AAC5D;;AClDA;;AAEG;;;;"} | ||
| {"version":3,"file":"nativescript-angular-polyfills.mjs","sources":["../../../../packages/angular/polyfills/src/index.ts","../../../../packages/angular/polyfills/src/nativescript-angular-polyfills.ts"],"sourcesContent":["import { AbortController, AbortSignal } from '@nativescript/core/abortcontroller';\nexport const nsNgPolyfills = true;\n\nglobal.performance ??= {} as unknown as Performance;\n\nfunction getPerformanceObject() {\n const loadTime = Date.now();\n const performance: Partial<Performance> = {\n timeOrigin: loadTime,\n now() {\n return Date.now() - loadTime;\n },\n mark(name: string, options: PerformanceMarkOptions) {\n return {\n detail: options?.detail,\n duration: 0,\n entryType: 'mark',\n name,\n startTime: options?.startTime ?? Date.now() - loadTime,\n toJSON: () => {\n ('');\n },\n };\n },\n };\n return performance;\n}\n\nconst polyfilledPerformance = getPerformanceObject();\n\nfor (const key in polyfilledPerformance) {\n global.performance[key] ??= polyfilledPerformance[key];\n}\n\nif (typeof queueMicrotask === 'undefined') {\n global.queueMicrotask = (cb) => Promise.resolve().then(cb);\n}\n\nif (typeof global.AbortController === 'undefined') {\n // @ts-expect-error handling global namespace\n global.AbortController = AbortController;\n}\n\nif (typeof global.AbortSignal === 'undefined') {\n // @ts-expect-error handling global namespace\n global.AbortSignal = AbortSignal;\n}\n\nif (typeof queueMicrotask === 'undefined') {\n global.queueMicrotask = (cb) => Promise.resolve().then(cb);\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;AACO,MAAM,aAAa,GAAG;AAE7B,MAAM,CAAC,WAAW,KAAK,EAA4B;AAEnD,SAAS,oBAAoB,GAAA;AAC3B,IAAA,MAAM,QAAQ,GAAG,IAAI,CAAC,GAAG,EAAE;AAC3B,IAAA,MAAM,WAAW,GAAyB;AACxC,QAAA,UAAU,EAAE,QAAQ;QACpB,GAAG,GAAA;AACD,YAAA,OAAO,IAAI,CAAC,GAAG,EAAE,GAAG,QAAQ;QAC9B,CAAC;QACD,IAAI,CAAC,IAAY,EAAE,OAA+B,EAAA;YAChD,OAAO;gBACL,MAAM,EAAE,OAAO,EAAE,MAAM;AACvB,gBAAA,QAAQ,EAAE,CAAC;AACX,gBAAA,SAAS,EAAE,MAAM;gBACjB,IAAI;gBACJ,SAAS,EAAE,OAAO,EAAE,SAAS,IAAI,IAAI,CAAC,GAAG,EAAE,GAAG,QAAQ;gBACtD,MAAM,EAAE,MAAK;oBACX,CAAC,EAAE;gBACL,CAAC;aACF;QACH,CAAC;KACF;AACD,IAAA,OAAO,WAAW;AACpB;AAEA,MAAM,qBAAqB,GAAG,oBAAoB,EAAE;AAEpD,KAAK,MAAM,GAAG,IAAI,qBAAqB,EAAE;IACvC,MAAM,CAAC,WAAW,CAAC,GAAG,CAAC,KAAK,qBAAqB,CAAC,GAAG,CAAC;AACxD;AAEA,IAAI,OAAO,cAAc,KAAK,WAAW,EAAE;AACzC,IAAA,MAAM,CAAC,cAAc,GAAG,CAAC,EAAE,KAAK,OAAO,CAAC,OAAO,EAAE,CAAC,IAAI,CAAC,EAAE,CAAC;AAC5D;AAEA,IAAI,OAAO,MAAM,CAAC,eAAe,KAAK,WAAW,EAAE;;AAEjD,IAAA,MAAM,CAAC,eAAe,GAAG,eAAe;AAC1C;AAEA,IAAI,OAAO,MAAM,CAAC,WAAW,KAAK,WAAW,EAAE;;AAE7C,IAAA,MAAM,CAAC,WAAW,GAAG,WAAW;AAClC;AAEA,IAAI,OAAO,cAAc,KAAK,WAAW,EAAE;AACzC,IAAA,MAAM,CAAC,cAAc,GAAG,CAAC,EAAE,KAAK,OAAO,CAAC,OAAO,EAAE,CAAC,IAAI,CAAC,EAAE,CAAC;AAC5D;;AClDA;;AAEG;;;;"} |
@@ -46,6 +46,6 @@ import { Frame, GridLayout, ProxyViewContainer } from '@nativescript/core'; | ||
| } | ||
| static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.0.3", ngImport: i0, type: NativeScriptTestComponentRenderer, deps: null, target: i0.ɵɵFactoryTarget.Injectable }); } | ||
| static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "20.0.3", ngImport: i0, type: NativeScriptTestComponentRenderer }); } | ||
| static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.0.0", ngImport: i0, type: NativeScriptTestComponentRenderer, deps: null, target: i0.ɵɵFactoryTarget.Injectable }); } | ||
| static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "21.0.0", ngImport: i0, type: NativeScriptTestComponentRenderer }); } | ||
| } | ||
| i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.0.3", ngImport: i0, type: NativeScriptTestComponentRenderer, decorators: [{ | ||
| i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.0.0", ngImport: i0, type: NativeScriptTestComponentRenderer, decorators: [{ | ||
| type: Injectable | ||
@@ -71,7 +71,7 @@ }] }); | ||
| class NativeScriptTestingModule { | ||
| static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.0.3", ngImport: i0, type: NativeScriptTestingModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule }); } | ||
| static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "20.0.3", ngImport: i0, type: NativeScriptTestingModule, exports: [NativeScriptModule] }); } | ||
| static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "20.0.3", ngImport: i0, type: NativeScriptTestingModule, providers: NATIVESCRIPT_TESTING_PROVIDERS, imports: [NativeScriptModule] }); } | ||
| static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.0.0", ngImport: i0, type: NativeScriptTestingModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule }); } | ||
| static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "21.0.0", ngImport: i0, type: NativeScriptTestingModule, exports: [NativeScriptModule] }); } | ||
| static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "21.0.0", ngImport: i0, type: NativeScriptTestingModule, providers: NATIVESCRIPT_TESTING_PROVIDERS, imports: [NativeScriptModule] }); } | ||
| } | ||
| i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.0.3", ngImport: i0, type: NativeScriptTestingModule, decorators: [{ | ||
| i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.0.0", ngImport: i0, type: NativeScriptTestingModule, decorators: [{ | ||
| type: NgModule, | ||
@@ -78,0 +78,0 @@ args: [{ |
@@ -1,1 +0,1 @@ | ||
| {"version":3,"file":"nativescript-angular-testing.mjs","sources":["../../../../packages/angular/testing/src/lib/test-root-view.ts","../../../../packages/angular/testing/src/lib/nativescript_test_component_renderer.ts","../../../../packages/angular/testing/src/lib/nativescript-testing.module.ts","../../../../packages/angular/testing/src/lib/util.ts","../../../../packages/angular/testing/src/nativescript-angular-testing.ts"],"sourcesContent":["import { LayoutBase, GridLayout, Frame, View } from '@nativescript/core';\n\nconst TESTING_ROOT_ID = '__testing_container';\n\n/**\n * Get a reference to the fixtures container.\n */\nexport function testingRootView(): LayoutBase {\n const rootPageLayout = Frame.topmost().currentPage.content as LayoutBase;\n\n let testingRoot: LayoutBase;\n rootPageLayout.eachChild((child: View) => {\n if (child.id === TESTING_ROOT_ID) {\n testingRoot = child as LayoutBase;\n // rootPageLayout.removeChild(child);\n return false;\n }\n return true;\n });\n\n if (!testingRoot) {\n testingRoot = new GridLayout();\n testingRoot.id = TESTING_ROOT_ID;\n GridLayout.setColumnSpan(testingRoot, 100);\n GridLayout.setRowSpan(testingRoot, 100);\n rootPageLayout.addChild(testingRoot);\n }\n\n return testingRoot;\n}\n","import { Injectable } from '@angular/core';\nimport { TestComponentRenderer } from '@angular/core/testing';\nimport { ProxyViewContainer } from '@nativescript/core';\nimport { testingRootView } from './test-root-view';\n\n/**\n * A NativeScript based implementation of the TestComponentRenderer.\n */\n@Injectable()\nexport class NativeScriptTestComponentRenderer extends TestComponentRenderer {\n insertRootElement(rootElId: string) {\n const layout = new ProxyViewContainer();\n layout.id = rootElId;\n\n const rootLayout = testingRootView();\n while (rootLayout.getChildrenCount() > 0) {\n rootLayout.removeChild(rootLayout.getChildAt(0));\n }\n rootLayout.addChild(layout);\n }\n}\n","import { NgModule, Provider } from '@angular/core';\nimport { TestComponentRenderer } from '@angular/core/testing';\nimport { COMMON_PROVIDERS, APP_ROOT_VIEW, NativeScriptModule } from '@nativescript/angular';\nimport { NativeScriptTestComponentRenderer } from './nativescript_test_component_renderer';\nimport { testingRootView } from './test-root-view';\n\nif (typeof Node === 'undefined' && !global.Node) {\n class DummyNode {}\n global.Node = DummyNode as any;\n}\n\n/**\n * Providers array is exported for cases where a custom module has to be constructed\n * to test a particular piece of code. This can happen, for example, if you are trying\n * to test dynamic component loading and need to specify an entryComponent for the testing\n * module.\n */\nexport const NATIVESCRIPT_TESTING_PROVIDERS: Provider[] = [...COMMON_PROVIDERS, { provide: APP_ROOT_VIEW, useFactory: testingRootView }, { provide: TestComponentRenderer, useClass: NativeScriptTestComponentRenderer }];\n\n/**\n * NativeScript testing support module. Enables use of TestBed for angular components, directives,\n * pipes, and services.\n */\n@NgModule({\n exports: [NativeScriptModule],\n providers: NATIVESCRIPT_TESTING_PROVIDERS,\n})\nexport class NativeScriptTestingModule {}\n","import { NativeScriptModule } from '@nativescript/angular';\nimport { View, Frame, LayoutBase, GridLayout } from '@nativescript/core';\nimport { NgModule, Type } from '@angular/core';\nimport { ComponentFixture, TestBed } from '@angular/core/testing';\nimport { CommonModule } from '@angular/common';\nimport { platformBrowserDynamicTesting } from '@angular/platform-browser-dynamic/testing';\n// import { NS_COMPILER_PROVIDERS } from \"../../platform\";\nimport { NATIVESCRIPT_TESTING_PROVIDERS, NativeScriptTestingModule } from './nativescript-testing.module';\nimport { testingRootView } from './test-root-view';\n\n/**\n * Declared test contexts. When the suite is done this map should be empty if all lifecycle\n * calls have happened as expected.\n * @private\n */\nconst activeTestFixtures: ComponentFixture<any>[][] = [];\n\n/**\n * Return a promise that resolves after (durationMs) milliseconds\n */\nexport function promiseWait(durationMs: number) {\n return () => new Promise<void>((resolve) => setTimeout(() => resolve(), durationMs));\n}\n\n/**\n * Perform basic TestBed environment initialization. Call this once in the main entry point to your tests.\n * @deprecated\n */\nexport function nsTestBedInit() {\n TestBed.initTestEnvironment(\n NativeScriptTestingModule,\n platformBrowserDynamicTesting() // NS_COMPILER_PROVIDERS)\n );\n}\n\n/**\n * Helper for configuring a TestBed instance for rendering components for test. Ideally this\n * would not be needed, and in truth it's just a wrapper to eliminate some boilerplate. It\n * exists because when you need to specify `entryComponents` for a test the setup becomes quite\n * a bit more complex than if you're just doing a basic component test.\n *\n * More about entryComponents complexity: https://github.com/angular/angular/issues/12079\n *\n * Use:\n * ```\n * beforeEach(nsTestBedBeforeEach([MyComponent,MyFailComponent]));\n * ```\n *\n * **NOTE*** Remember to pair with {@see nsTestBedAfterEach}\n *\n * @deprecated\n * @param components Any components that you will create during the test\n * @param providers Any services your tests depend on\n * @param imports Any module imports your tests depend on\n * @param entryComponents Any entry components that your tests depend on\n */\nexport function nsTestBedBeforeEach(components: any[], providers: any[] = [], imports: any[] = [], entryComponents: any[] = []) {\n return (done) => {\n activeTestFixtures.push([]);\n // If there are no entry components we can take the simple path.\n if (entryComponents.length === 0) {\n TestBed.configureTestingModule({\n declarations: [...components],\n providers: [...providers],\n imports: [NativeScriptModule, ...imports],\n });\n } else {\n // If there are entry components, we have to reset the testing platform.\n //\n // There's got to be a better way... (o_O)\n // TestBed.resetTestEnvironment();\n // @NgModule({\n // declarations: entryComponents,\n // exports: entryComponents,\n // entryComponents: entryComponents\n // })\n // class EntryComponentsTestModule {\n // }\n // TestBed.initTestEnvironment(\n // EntryComponentsTestModule,\n // platformBrowserDynamicTesting(NS_COMPILER_PROVIDERS)\n // );\n // TestBed.configureTestingModule({\n // declarations: components,\n // imports: [\n // NativeScriptModule, NativeScriptTestingModule, CommonModule,\n // ...imports\n // ],\n // providers: [...providers, ...NATIVESCRIPT_TESTING_PROVIDERS],\n // });\n }\n TestBed.compileComponents()\n .then(() => done())\n .catch((e) => {\n console.log(`Failed to instantiate test component with error: ${e}`);\n console.log(e.stack);\n done();\n });\n };\n}\n\n/**\n * Helper for a basic component TestBed clean up.\n * @param resetEnv When true the testing environment will be reset\n * @param resetFn When resetting the environment, use this init function\n * @deprecated\n */\nexport function nsTestBedAfterEach(resetEnv = true, resetFn = nsTestBedInit) {\n return () => {\n if (activeTestFixtures.length === 0) {\n throw new Error(`There are no more declared fixtures.` + `Did you call \"nsTestBedBeforeEach\" and \"nsTestBedAfterEach\" an equal number of times?`);\n }\n const root = testingRootView() as LayoutBase;\n const fixtures = activeTestFixtures.pop();\n fixtures.forEach((fixture) => {\n const fixtureView = <View>fixture.nativeElement;\n if (fixtureView.parent === root) {\n root.removeChild(fixtureView);\n }\n fixture.destroy();\n });\n TestBed.resetTestingModule();\n if (resetEnv) {\n TestBed.resetTestEnvironment();\n resetFn();\n }\n };\n}\n\n/**\n * Render a component using the TestBed helper, and return a promise that resolves when the\n * ComponentFixture is fully initialized.\n * @deprecated\n */\nexport function nsTestBedRender<T>(componentType: Type<T>): Promise<ComponentFixture<T>> {\n const fixture = TestBed.createComponent(componentType);\n fixture.detectChanges();\n return (\n fixture\n .whenRenderingDone()\n // TODO(jd): it seems that the whenStable and whenRenderingDone utilities of ComponentFixture\n // do not work as expected. I looked at how to fix it and it's not clear how to provide\n // a {N} specific subclass, because ComponentFixture is newed directly rather than injected\n // What to do about it? Maybe fakeAsync can help? For now just setTimeout for 100ms (x_X)\n .then(promiseWait(100))\n .then(() => {\n const list = activeTestFixtures[activeTestFixtures.length - 1];\n if (!list) {\n console.warn('nsTestBedRender called without nsTestBedBeforeEach/nsTestBedAfter each. ' + \"You are responsible for calling 'fixture.destroy()' when your test is done \" + 'in order to clean up the components that are created.');\n } else {\n list.push(fixture);\n }\n return fixture;\n })\n );\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;;;AAEA,MAAM,eAAe,GAAG,qBAAqB;AAE7C;;AAEG;SACa,eAAe,GAAA;IAC7B,MAAM,cAAc,GAAG,KAAK,CAAC,OAAO,EAAE,CAAC,WAAW,CAAC,OAAqB;AAExE,IAAA,IAAI,WAAuB;AAC3B,IAAA,cAAc,CAAC,SAAS,CAAC,CAAC,KAAW,KAAI;AACvC,QAAA,IAAI,KAAK,CAAC,EAAE,KAAK,eAAe,EAAE;YAChC,WAAW,GAAG,KAAmB;;AAEjC,YAAA,OAAO,KAAK;;AAEd,QAAA,OAAO,IAAI;AACb,KAAC,CAAC;IAEF,IAAI,CAAC,WAAW,EAAE;AAChB,QAAA,WAAW,GAAG,IAAI,UAAU,E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EAAE;AAC9B,YAAA,OAAO,EAAE;;AAEb,KAAC;AACH;AAEA;;;;AAIG;AACG,SAAU,eAAe,CAAI,aAAsB,EAAA;IACvD,MAAM,OAAO,GAAG,OAAO,CAAC,eAAe,CAAC,aAAa,CAAC;IACtD,OAAO,CAAC,aAAa,EAAE;AACvB,IAAA,QACE;AACG,SAAA,iBAAiB;;;;;AAKjB,SAAA,IAAI,CAAC,WAAW,CAAC,GAAG,CAAC;SACrB,IAAI,CAAC,MAAK;QACT,MAAM,IAAI,GAAG,kBAAkB,CAAC,kBAAkB,CAAC,MAAM,GAAG,CAAC,CAAC;QAC9D,IAAI,CAAC,IAAI,EAAE;YACT,OAAO,CAAC,IAAI,CAAC,0EAA0E,GAAG,6EAA6E,GAAG,uDAAuD,CAAC;;aAC7N;AACL,YAAA,IAAI,CAAC,IAAI,CAAC,OAAO,CAAC;;AAEpB,QAAA,OAAO,OAAO;KACf,CAAC;AAER;;AC3JA;;AAEG;;;;"} | ||
| {"version":3,"file":"nativescript-angular-testing.mjs","sources":["../../../../packages/angular/testing/src/lib/test-root-view.ts","../../../../packages/angular/testing/src/lib/nativescript_test_component_renderer.ts","../../../../packages/angular/testing/src/lib/nativescript-testing.module.ts","../../../../packages/angular/testing/src/lib/util.ts","../../../../packages/angular/testing/src/nativescript-angular-testing.ts"],"sourcesContent":["import { LayoutBase, GridLayout, Frame, View } from '@nativescript/core';\n\nconst TESTING_ROOT_ID = '__testing_container';\n\n/**\n * Get a reference to the fixtures container.\n */\nexport function testingRootView(): LayoutBase {\n const rootPageLayout = Frame.topmost().currentPage.content as LayoutBase;\n\n let testingRoot: LayoutBase;\n rootPageLayout.eachChild((child: View) => {\n if (child.id === TESTING_ROOT_ID) {\n testingRoot = child as LayoutBase;\n // rootPageLayout.removeChild(child);\n return false;\n }\n return true;\n });\n\n if (!testingRoot) {\n testingRoot = new GridLayout();\n testingRoot.id = TESTING_ROOT_ID;\n GridLayout.setColumnSpan(testingRoot, 100);\n GridLayout.setRowSpan(testingRoot, 100);\n rootPageLayout.addChild(testingRoot);\n }\n\n return testingRoot;\n}\n","import { Injectable } from '@angular/core';\nimport { TestComponentRenderer } from '@angular/core/testing';\nimport { ProxyViewContainer } from '@nativescript/core';\nimport { testingRootView } from './test-root-view';\n\n/**\n * A NativeScript based implementation of the TestComponentRenderer.\n */\n@Injectable()\nexport class NativeScriptTestComponentRenderer extends TestComponentRenderer {\n insertRootElement(rootElId: string) {\n const layout = new ProxyViewContainer();\n layout.id = rootElId;\n\n const rootLayout = testingRootView();\n while (rootLayout.getChildrenCount() > 0) {\n rootLayout.removeChild(rootLayout.getChildAt(0));\n }\n rootLayout.addChild(layout);\n }\n}\n","import { NgModule, Provider } from '@angular/core';\nimport { TestComponentRenderer } from '@angular/core/testing';\nimport { COMMON_PROVIDERS, APP_ROOT_VIEW, NativeScriptModule } from '@nativescript/angular';\nimport { NativeScriptTestComponentRenderer } from './nativescript_test_component_renderer';\nimport { testingRootView } from './test-root-view';\n\nif (typeof Node === 'undefined' && !global.Node) {\n class DummyNode {}\n global.Node = DummyNode as any;\n}\n\n/**\n * Providers array is exported for cases where a custom module has to be constructed\n * to test a particular piece of code. This can happen, for example, if you are trying\n * to test dynamic component loading and need to specify an entryComponent for the testing\n * module.\n */\nexport const NATIVESCRIPT_TESTING_PROVIDERS: Provider[] = [...COMMON_PROVIDERS, { provide: APP_ROOT_VIEW, useFactory: testingRootView }, { provide: TestComponentRenderer, useClass: NativeScriptTestComponentRenderer }];\n\n/**\n * NativeScript testing support module. Enables use of TestBed for angular components, directives,\n * pipes, and services.\n */\n@NgModule({\n exports: [NativeScriptModule],\n providers: NATIVESCRIPT_TESTING_PROVIDERS,\n})\nexport class NativeScriptTestingModule {}\n","import { NativeScriptModule } from '@nativescript/angular';\nimport { View, Frame, LayoutBase, GridLayout } from '@nativescript/core';\nimport { NgModule, Type } from '@angular/core';\nimport { ComponentFixture, TestBed } from '@angular/core/testing';\nimport { CommonModule } from '@angular/common';\nimport { platformBrowserDynamicTesting } from '@angular/platform-browser-dynamic/testing';\n// import { NS_COMPILER_PROVIDERS } from \"../../platform\";\nimport { NATIVESCRIPT_TESTING_PROVIDERS, NativeScriptTestingModule } from './nativescript-testing.module';\nimport { testingRootView } from './test-root-view';\n\n/**\n * Declared test contexts. When the suite is done this map should be empty if all lifecycle\n * calls have happened as expected.\n * @private\n */\nconst activeTestFixtures: ComponentFixture<any>[][] = [];\n\n/**\n * Return a promise that resolves after (durationMs) milliseconds\n */\nexport function promiseWait(durationMs: number) {\n return () => new Promise<void>((resolve) => setTimeout(() => resolve(), durationMs));\n}\n\n/**\n * Perform basic TestBed environment initialization. Call this once in the main entry point to your tests.\n * @deprecated\n */\nexport function nsTestBedInit() {\n TestBed.initTestEnvironment(\n NativeScriptTestingModule,\n platformBrowserDynamicTesting() // NS_COMPILER_PROVIDERS)\n );\n}\n\n/**\n * Helper for configuring a TestBed instance for rendering components for test. Ideally this\n * would not be needed, and in truth it's just a wrapper to eliminate some boilerplate. It\n * exists because when you need to specify `entryComponents` for a test the setup becomes quite\n * a bit more complex than if you're just doing a basic component test.\n *\n * More about entryComponents complexity: https://github.com/angular/angular/issues/12079\n *\n * Use:\n * ```\n * beforeEach(nsTestBedBeforeEach([MyComponent,MyFailComponent]));\n * ```\n *\n * **NOTE*** Remember to pair with {@see nsTestBedAfterEach}\n *\n * @deprecated\n * @param components Any components that you will create during the test\n * @param providers Any services your tests depend on\n * @param imports Any module imports your tests depend on\n * @param entryComponents Any entry components that your tests depend on\n */\nexport function nsTestBedBeforeEach(components: any[], providers: any[] = [], imports: any[] = [], entryComponents: any[] = []) {\n return (done) => {\n activeTestFixtures.push([]);\n // If there are no entry components we can take the simple path.\n if (entryComponents.length === 0) {\n TestBed.configureTestingModule({\n declarations: [...components],\n providers: [...providers],\n imports: [NativeScriptModule, ...imports],\n });\n } else {\n // If there are entry components, we have to reset the testing platform.\n //\n // There's got to be a better way... (o_O)\n // TestBed.resetTestEnvironment();\n // @NgModule({\n // declarations: entryComponents,\n // exports: entryComponents,\n // entryComponents: entryComponents\n // })\n // class EntryComponentsTestModule {\n // }\n // TestBed.initTestEnvironment(\n // EntryComponentsTestModule,\n // platformBrowserDynamicTesting(NS_COMPILER_PROVIDERS)\n // );\n // TestBed.configureTestingModule({\n // declarations: components,\n // imports: [\n // NativeScriptModule, NativeScriptTestingModule, CommonModule,\n // ...imports\n // ],\n // providers: [...providers, ...NATIVESCRIPT_TESTING_PROVIDERS],\n // });\n }\n TestBed.compileComponents()\n .then(() => done())\n .catch((e) => {\n console.log(`Failed to instantiate test component with error: ${e}`);\n console.log(e.stack);\n done();\n });\n };\n}\n\n/**\n * Helper for a basic component TestBed clean up.\n * @param resetEnv When true the testing environment will be reset\n * @param resetFn When resetting the environment, use this init function\n * @deprecated\n */\nexport function nsTestBedAfterEach(resetEnv = true, resetFn = nsTestBedInit) {\n return () => {\n if (activeTestFixtures.length === 0) {\n throw new Error(`There are no more declared fixtures.` + `Did you call \"nsTestBedBeforeEach\" and \"nsTestBedAfterEach\" an equal number of times?`);\n }\n const root = testingRootView() as LayoutBase;\n const fixtures = activeTestFixtures.pop();\n fixtures.forEach((fixture) => {\n const fixtureView = <View>fixture.nativeElement;\n if (fixtureView.parent === root) {\n root.removeChild(fixtureView);\n }\n fixture.destroy();\n });\n TestBed.resetTestingModule();\n if (resetEnv) {\n TestBed.resetTestEnvironment();\n resetFn();\n }\n };\n}\n\n/**\n * Render a component using the TestBed helper, and return a promise that resolves when the\n * ComponentFixture is fully initialized.\n * @deprecated\n */\nexport function nsTestBedRender<T>(componentType: Type<T>): Promise<ComponentFixture<T>> {\n const fixture = TestBed.createComponent(componentType);\n fixture.detectChanges();\n return (\n fixture\n .whenRenderingDone()\n // TODO(jd): it seems that the whenStable and whenRenderingDone utilities of ComponentFixture\n // do not work as expected. I looked at how to fix it and it's not clear how to provide\n // a {N} specific subclass, because ComponentFixture is newed directly rather than injected\n // What to do about it? Maybe fakeAsync can help? For now just setTimeout for 100ms (x_X)\n .then(promiseWait(100))\n .then(() => {\n const list = activeTestFixtures[activeTestFixtures.length - 1];\n if (!list) {\n console.warn('nsTestBedRender called without nsTestBedBeforeEach/nsTestBedAfter each. ' + \"You are responsible for calling 'fixture.destroy()' when your test is done \" + 'in order to clean up the components that are created.');\n } else {\n list.push(fixture);\n }\n return fixture;\n })\n );\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;;;AAEA,MAAM,eAAe,GAAG,qBAAqB;AAE7C;;AAEG;SACa,eAAe,GAAA;IAC7B,MAAM,cAAc,GAAG,KAAK,CAAC,OAAO,EAAE,CAAC,WAAW,CAAC,OAAqB;AAExE,IAAA,IAAI,WAAuB;AAC3B,IAAA,cAAc,CAAC,SAAS,CAAC,CAAC,KAAW,KAAI;AACvC,QAAA,IAAI,KAAK,CAAC,EAAE,KAAK,eAAe,EAAE;YAChC,WAAW,GAAG,KAAmB;;AAEjC,YAAA,OAAO,KAAK;QACd;AACA,QAAA,OAAO,IAAI;AACb,IAAA,CAAC,CAAC;IAEF,IAAI,CAAC,WAAW,EAAE;AAChB,QAAA,WAAW,GAAG,IAAI,UAAU,EAAE;AAC9B,QAAA,WAAW,CAAC,EAAE,GAAG,eAAe;AAChC,QAAA,UAAU,CAAC,aAAa,CAAC,WAAW,EAAE,GAAG,CAAC;AAC1C,QAAA,UAAU,CAAC,UAAU,CAAC,WAAW,EAAE,GAAG,CAAC;AACvC,QAAA,cAAc,CAAC,QAAQ,CAAC,WAAW,CAAC;IACtC;AAEA,IAAA,OAAO,WAAW;AACpB;;ACxBA;;AAEG;AAEG,MAAO,iCAAkC,SAAQ,qBAAqB,CAAA;AAC1E,IAAA,iBAAiB,CAAC,QAAgB,EAAA;AAChC,QAAA,MAAM,MAAM,GAAG,IAAI,kBAAkB,EAAE;AACvC,QAAA,MAAM,CAAC,EAAE,GAAG,QAAQ;AAEpB,QAAA,MAAM,UAAU,GAAG,eAAe,EAAE;AACpC,QAAA,OAAO,U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,6EAA6E,GAAG,uDAAuD,CAAC;QACpO;aAAO;AACL,YAAA,IAAI,CAAC,IAAI,CAAC,OAAO,CAAC;QACpB;AACA,QAAA,OAAO,OAAO;IAChB,CAAC,CAAC;AAER;;AC3JA;;AAEG;;;;"} |
+5
-5
| { | ||
| "name": "@nativescript/angular", | ||
| "version": "20.0.1-rc.1", | ||
| "version": "21.0.0-rc.0", | ||
| "homepage": "https://nativescript.org/", | ||
@@ -27,3 +27,3 @@ "repository": { | ||
| "module": "fesm2022/nativescript-angular.mjs", | ||
| "typings": "index.d.ts", | ||
| "typings": "types/nativescript-angular.d.ts", | ||
| "exports": { | ||
@@ -34,11 +34,11 @@ "./package.json": { | ||
| ".": { | ||
| "types": "./index.d.ts", | ||
| "types": "./types/nativescript-angular.d.ts", | ||
| "default": "./fesm2022/nativescript-angular.mjs" | ||
| }, | ||
| "./polyfills": { | ||
| "types": "./polyfills/index.d.ts", | ||
| "types": "./types/nativescript-angular-polyfills.d.ts", | ||
| "default": "./fesm2022/nativescript-angular-polyfills.mjs" | ||
| }, | ||
| "./testing": { | ||
| "types": "./testing/index.d.ts", | ||
| "types": "./types/nativescript-angular-testing.d.ts", | ||
| "default": "./fesm2022/nativescript-angular-testing.mjs" | ||
@@ -45,0 +45,0 @@ } |
Sorry, the diff of this file is too big to display
| declare const nsNgPolyfills = true; | ||
| export { nsNgPolyfills }; |
| import { LayoutBase } from '@nativescript/core'; | ||
| import { TestComponentRenderer, ComponentFixture } from '@angular/core/testing'; | ||
| import * as i0 from '@angular/core'; | ||
| import { Provider, Type } from '@angular/core'; | ||
| import * as i1 from '@nativescript/angular'; | ||
| /** | ||
| * Get a reference to the fixtures container. | ||
| */ | ||
| declare function testingRootView(): LayoutBase; | ||
| /** | ||
| * A NativeScript based implementation of the TestComponentRenderer. | ||
| */ | ||
| declare class NativeScriptTestComponentRenderer extends TestComponentRenderer { | ||
| insertRootElement(rootElId: string): void; | ||
| static ɵfac: i0.ɵɵFactoryDeclaration<NativeScriptTestComponentRenderer, never>; | ||
| static ɵprov: i0.ɵɵInjectableDeclaration<NativeScriptTestComponentRenderer>; | ||
| } | ||
| /** | ||
| * Providers array is exported for cases where a custom module has to be constructed | ||
| * to test a particular piece of code. This can happen, for example, if you are trying | ||
| * to test dynamic component loading and need to specify an entryComponent for the testing | ||
| * module. | ||
| */ | ||
| declare const NATIVESCRIPT_TESTING_PROVIDERS: Provider[]; | ||
| /** | ||
| * NativeScript testing support module. Enables use of TestBed for angular components, directives, | ||
| * pipes, and services. | ||
| */ | ||
| declare class NativeScriptTestingModule { | ||
| static ɵfac: i0.ɵɵFactoryDeclaration<NativeScriptTestingModule, never>; | ||
| static ɵmod: i0.ɵɵNgModuleDeclaration<NativeScriptTestingModule, never, never, [typeof i1.NativeScriptModule]>; | ||
| static ɵinj: i0.ɵɵInjectorDeclaration<NativeScriptTestingModule>; | ||
| } | ||
| /** | ||
| * Return a promise that resolves after (durationMs) milliseconds | ||
| */ | ||
| declare function promiseWait(durationMs: number): () => Promise<void>; | ||
| /** | ||
| * Perform basic TestBed environment initialization. Call this once in the main entry point to your tests. | ||
| * @deprecated | ||
| */ | ||
| declare function nsTestBedInit(): void; | ||
| /** | ||
| * Helper for configuring a TestBed instance for rendering components for test. Ideally this | ||
| * would not be needed, and in truth it's just a wrapper to eliminate some boilerplate. It | ||
| * exists because when you need to specify `entryComponents` for a test the setup becomes quite | ||
| * a bit more complex than if you're just doing a basic component test. | ||
| * | ||
| * More about entryComponents complexity: https://github.com/angular/angular/issues/12079 | ||
| * | ||
| * Use: | ||
| * ``` | ||
| * beforeEach(nsTestBedBeforeEach([MyComponent,MyFailComponent])); | ||
| * ``` | ||
| * | ||
| * **NOTE*** Remember to pair with {@see nsTestBedAfterEach} | ||
| * | ||
| * @deprecated | ||
| * @param components Any components that you will create during the test | ||
| * @param providers Any services your tests depend on | ||
| * @param imports Any module imports your tests depend on | ||
| * @param entryComponents Any entry components that your tests depend on | ||
| */ | ||
| declare function nsTestBedBeforeEach(components: any[], providers?: any[], imports?: any[], entryComponents?: any[]): (done: any) => void; | ||
| /** | ||
| * Helper for a basic component TestBed clean up. | ||
| * @param resetEnv When true the testing environment will be reset | ||
| * @param resetFn When resetting the environment, use this init function | ||
| * @deprecated | ||
| */ | ||
| declare function nsTestBedAfterEach(resetEnv?: boolean, resetFn?: typeof nsTestBedInit): () => void; | ||
| /** | ||
| * Render a component using the TestBed helper, and return a promise that resolves when the | ||
| * ComponentFixture is fully initialized. | ||
| * @deprecated | ||
| */ | ||
| declare function nsTestBedRender<T>(componentType: Type<T>): Promise<ComponentFixture<T>>; | ||
| export { NATIVESCRIPT_TESTING_PROVIDERS, NativeScriptTestComponentRenderer, NativeScriptTestingModule, nsTestBedAfterEach, nsTestBedBeforeEach, nsTestBedInit, nsTestBedRender, promiseWait, testingRootView }; |
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
Long strings
Supply chain riskContains long string literals, which may be a sign of obfuscated or packed code.
Found 1 instance in 1 package
Long strings
Supply chain riskContains long string literals, which may be a sign of obfuscated or packed code.
Found 1 instance in 1 package
1022778
0.44%10264
-0.02%