import { applySnapshot , makeSnapshot } from "./snapshot" ; export function fastBeforeEach ( fn ) { let initialState ; let stateBeforeTest ; before ( async function ( this ) { initialState = await makeSnapshot ( ) ; return await fn . apply ( this ) ; } ) ; beforeEach ( async ( ) => { stateBeforeTest = await makeSnapshot ( ) ; } ) ; afterEach ( async ( ) => { await applySnapshot ( stateBeforeTest ) ; } ) ; after ( async ( ) => { await applySnapshot ( initialState ) ; } ) ; }