feat: mobile app package (#1075)

This commit is contained in:
Mo
2022-06-09 09:45:15 -05:00
committed by GitHub
parent 58b63898de
commit 8248a38280
336 changed files with 47696 additions and 22563 deletions

View File

@@ -0,0 +1,37 @@
/* eslint-disable no-undef */
const detox = require('detox');
const config = require('../package.json').detox;
const adapter = require('detox/runners/jest/adapter');
const specReporter = require('detox/runners/jest/specReporter');
const assignReporter = require('detox/runners/jest/assignReporter');
// Set the default timeout
jest.setTimeout(120000);
detoxCircus.getEnv().addEventsListener(adapter);
detoxCircus.getEnv().addEventsListener(specReporter);
detoxCircus.getEnv().addEventsListener(assignReporter);
beforeAll(async () => {
await detox.init(config);
}, 600000);
// beforeEach(async () => {
// try {
// await adapter.beforeEach();
// } catch (err) {
// // Workaround for the 'jest-jasmine' runner (default one): if 'beforeAll' hook above fails with a timeout,
// // unfortunately, 'jest' might continue running other hooks and test suites. To prevent that behavior,
// // adapter.beforeEach() will throw if detox.init() is still running; that allows us to run detox.cleanup()
// // in that emergency case and disable calling 'device', 'element', 'expect', 'by' and other Detox globals.
// // If you switch to 'jest-circus' runner, you can omit this try-catch workaround at all.
// await detox.cleanup();
// throw err;
// }
// });
afterAll(async () => {
await adapter.afterAll();
await detox.cleanup();
});