Merge pull request #32927 from solkaz/detox-default-export

[detox] Remove named export, define default export
This commit is contained in:
Nathan Shively-Sanders
2019-03-05 08:44:16 -08:00
committed by GitHub
5 changed files with 18 additions and 10 deletions
+12 -6
View File
@@ -42,6 +42,16 @@ declare global {
*/
cleanup(): Promise<void>;
}
// Detox exports all methods from detox global and all of the global constants.
interface DetoxExport extends Detox {
device: Device;
element: Element;
waitFor: WaitFor;
expect: Expect<Expect<any>>;
by: Matchers;
}
interface Device {
/**
* Launch the app
@@ -434,10 +444,6 @@ declare global {
}
}
export { by, detox, device, element, waitFor };
declare const detoxExport: Detox.DetoxExport;
// Not exporting the global `expect` from the top of the file here
// because `expect` conflicts with the global `expect` of jest and
// therefore exporting it doesn't work. The global `expect` is kept
// for backwards compatibility though.
export const expect: Detox.Expect<Detox.Expect<any>>;
export = detoxExport;
+1 -1
View File
@@ -9,4 +9,4 @@ interface DetoxJestAdapter {
declare const adapter: DetoxJestAdapter;
export default adapter;
export = adapter;
+1 -1
View File
@@ -6,4 +6,4 @@ interface DetoxMochaAdapter {
declare const adapter: DetoxMochaAdapter;
export default adapter;
export = adapter;
+2 -1
View File
@@ -2,7 +2,8 @@ declare var beforeAll: (callback: () => void) => void;
declare var beforeEach: (callback: () => void) => void;
declare var afterAll: (callback: () => void) => void;
import adapter from "detox/runners/jest/adapter";
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;
+2 -1
View File
@@ -5,7 +5,8 @@ declare var beforeEach: (callback: () => void) => void;
declare var after: (callback: () => void) => void;
declare var afterEach: (callback: () => void) => void;
import adapter from "detox/runners/mocha/adapter";
import * as detox from "detox";
import * as adapter from "detox/runners/mocha/adapter";
// Normally the Detox configuration from the project's package.json like so:
// const config = require("./package.json").detox;