import { ipcRenderer } from 'electron' ; import { ComponentFixture , getTestBed , TestBed } from '@angular/core/testing' ; example export function fastTestSetup ( ) { const testBedApi = getTestBed ( ) ; const originReset = TestBed . resetTestingModule ; beforeAll ( ( ) => { TestBed . resetTestingModule ( ) ; TestBed . resetTestingModule = ( ) => TestBed ; } ) ; afterEach ( ( ) => { testBedApi . _activeFixtures . forEach ( ( fixture ) => fixture . destroy ( ) ) ; testBedApi . _instantiated = false ; ipcRenderer . removeAllListeners ( 'git' ) ; ipcRenderer . removeAllListeners ( 'workspace' ) ; ipcRenderer . removeAllListeners ( 'menu' ) ; } ) ; afterAll ( ( ) => { TestBed . resetTestingModule = originReset ; TestBed . resetTestingModule ( ) ; } ) ; }