[Detox] DetoxJestAdapter overlaps CustomReporter

DetoxJestAdapter needs to overlap jasmine.CustomReporter since the
latter is a weak interface; otherwise the code that is needed
to run Detox with Jest will throw errors when compiled.
This commit is contained in:
Jeff Held
2018-12-20 15:43:36 -06:00
parent 4de46a542c
commit c71bd7b974
2 changed files with 6 additions and 0 deletions

View File

@@ -2,6 +2,9 @@ interface DetoxJestAdapter {
detox: Detox.Detox;
beforeEach: () => Promise<void>;
afterAll: () => Promise<void>;
// These are not publicly used, but are defined in order to overlap with the jasmine.CustomReporter interface (which is a weak interface)
specDone: () => void;
specStarted: () => void;
}
declare const adapter: DetoxJestAdapter;

View File

@@ -8,6 +8,9 @@ import adapter from "detox/runners/jest/adapter";
// const config = require("./package.json").detox;
declare const config: any;
declare const jasmine: any;
jasmine.getEnv().addReporter(adapter);
beforeAll(async () => {
await detox.init(config);