/* eslint-env jest */
/* global device */

const detox = require('detox')
const jasmine = require('jest-jasmine2')
const config = require('../package.json').detox
const adapter = require('detox/runners/jest/adapter')

jest.setTimeout(120000)

beforeAll(async () => {
	await detox.init(config, {launchApp: false})
	jasmine.getEnv().addReporter(adapter)
})

beforeEach(async () => {
	await adapter.beforeEach()
	await device.relaunchApp({delete: true})
})

afterAll(async () => {
	await adapter.afterAll()
	await detox.cleanup()
})

@@ -40,152 +40,209 @@
 */%0A%0A
-const detox = require('detox')%0Aconst jasmine = require('jest-jasmine2')%0Aconst config = require('../package.json').detox%0Aconst adapter = require(
+import %7B init, cleanup %7D from 'detox'%0Aimport %7B getEnv %7D from 'jest-jasmine2'%0Aimport %7B detox as config %7D from '../package.json'%0Aimport adapter, %7B beforeEach as _beforeEach, afterAll as _afterAll %7D from 
 'det
@@ -265,17 +265,16 @@
 adapter'
-)
 %0A%0Ajest.s
@@ -323,22 +323,16 @@
 %0A%09await 
-detox.
 init(con
@@ -361,16 +361,8 @@
 %7D)%0A%09
-jasmine.
 getE
@@ -423,24 +423,17 @@
 %0A%09await 
-adapter.
+_
 beforeEa
@@ -517,16 +517,9 @@
 ait 
-adapter.
+_
 afte
@@ -536,14 +536,8 @@
 ait 
-detox.
 clea

convert e2e/init.js to a module