import nock from 'nock' ; export function nockBeforeEach ( ) { if ( ! nock . isActive ( ) ) { nock . activate ( ) ; } nock . cleanAll ( ) ; } export function nockAfterEach ( ) { nock . restore ( ) ; expect ( nock . activeMocks ( ) ) . toEqual ( [ ] ) ; } ;