declare var beforeAll: (callback: () => void) => void;
declare var beforeEach: (callback: () => void) => void;
declare var afterAll: (callback: () => void) => void;

import * as detox from "detox";
import * as adapter from "detox/runners/jest/adapter";

// Normally the Detox configuration from the project's package.json like so:
// const config = require("./package.json").detox;
declare const config: any;

declare const jasmine: any;
jasmine.getEnv().addReporter(adapter);

beforeAll(async () => {
    await detox.init(config);

    const initOptions: Detox.DetoxInitOptions = {
        initGlobals: false,
        launchApp: false,
    };
    await detox.init(config, initOptions);
});

beforeEach(async () => {
    await adapter.beforeEach();
});

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

declare var beforeAll: (callback: () => void) => void;
declare var beforeEach: (callback: () => void) => void;
declare var afterAll: (callback: () => void) => void;

import detox = require("detox");
import adapter = require("detox/runners/jest/adapter");

// Normally the Detox configuration from the project's package.json like so:
// const config = require("./package.json").detox;
declare const config: any;

declare const jasmine: any;
jasmine.getEnv().addReporter(adapter);

beforeAll(async () => {
    await detox.init(config);

    const initOptions: Detox.DetoxInitOptions = {
        initGlobals: false,
        launchApp: false,
    };
    await detox.init(config, initOptions);
});

beforeEach(async () => {
    await adapter.beforeEach();
});

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

Use `import = require` in jest setup tests
[detox] Use `import = require` in jest setup tests