MCPcopy
hub / github.com/bitpay/wallet / configurePageTestingModule

Method configurePageTestingModule

src/test.ts:228–279  ·  view source on GitHub ↗
(
    components,
    otherParams?
  )

Source from the content-addressed store, hash-verified

226 }
227
228 public static async configurePageTestingModule(
229 components,
230 otherParams?
231 ): Promise<{ fixture; instance; testBed: typeof TestBed }> {
232 const providers = (otherParams && otherParams.providers) || [];
233 await TestBed.configureTestingModule({
234 declarations: [
235 ...components,
236 KeysPipe,
237 OrderByPipe,
238 SatToFiatPipe,
239 SatToUnitPipe,
240 ShortenedAddressPipe,
241 InfoSheetComponent,
242 ActionSheetComponent
243 ],
244 imports: [...baseImports, MomentModule, ProvidersModule],
245 schemas: [NO_ERRORS_SCHEMA],
246 providers: [
247 ...baseProviders,
248 AppProvider,
249 DecimalPipe,
250 KeysPipe,
251 OrderByPipe,
252 SatToFiatPipe,
253 SatToUnitPipe,
254 ShortenedAddressPipe,
255 GestureController,
256 PlatformProvider,
257 ThemeProvider,
258 ...providers
259 ]
260 })
261 .overrideModule(BrowserDynamicTestingModule, {
262 set: {
263 entryComponents: [InfoSheetComponent, ActionSheetComponent]
264 }
265 })
266 .compileComponents();
267 const appProvider = TestBed.get(AppProvider);
268 spyOn(appProvider, 'getAppInfo').and.returnValue(
269 Promise.resolve(appTemplate)
270 );
271 spyOn(appProvider, 'getServicesInfo').and.returnValue(Promise.resolve({}));
272 await appProvider.load();
273 const fixture = TestBed.createComponent(components[0]);
274 return {
275 fixture,
276 instance: fixture.debugElement.componentInstance,
277 testBed: TestBed
278 };
279 }
280
281 public static configureProviderTestingModule(
282 providerOverrides: Array<{

Callers 15

tx-details.spec.tsFile · 0.80
pin-modal.spec.tsFile · 0.80
language.spec.tsFile · 0.80
about.spec.tsFile · 0.80
send.spec.tsFile · 0.80
confirm.spec.tsFile · 0.80

Calls 2

getMethod · 0.65
loadMethod · 0.45

Tested by

no test coverage detected