import helpers from "@tasit/test-helpers" ; import Action from "@tasit/action" ; const { developmentConfig , ProviderFactory , createSnapshot , revertFromSnapshot , mineBlocks , } = helpers ; const { ConfigLoader } = Action ; ConfigLoader . setConfig ( developmentConfig ) ; const provider = ProviderFactory . getProvider ( ) ; let snapshotId ; beforeEach ( async ( ) => { await provider . ready ; snapshotId = await createSnapshot ( provider ) ; while ( snapshotId > 1 ) { await revertFromSnapshot ( provider , snapshotId -- ) ; } expect ( snapshotId ) . toBe ( 1 ) ; } ) ; afterEach ( async ( ) => { expect ( snapshotId ) . toBe ( 1 ) ; await revertFromSnapshot ( provider , snapshotId ) ; await mineBlocks ( provider , 1 ) ; } ) ;