const detox = require ( 'detox' ) ; const adapter = require ( 'detox/runners/jest/adapter' ) ; const specReporter = require ( 'detox/runners/jest/specReporter' ) ; jest . setTimeout ( 120000 ) ; jasmine . getEnv ( ) . addReporter ( adapter ) ; jasmine . getEnv ( ) . addReporter ( specReporter ) ; beforeAll ( async ( ) => { await detox . init ( ) ; } , 300000 ) ; beforeEach ( async ( ) => { try { await adapter . beforeEach ( ) ; } catch ( err ) { await detox . cleanup ( ) ; throw err ; } } ) ; afterAll ( async ( ) => { await adapter . afterAll ( ) ; await detox . cleanup ( ) ; } ) ;