Skip to content

Commit

Permalink
fix: avoid using deprecated relaunchApp
Browse files Browse the repository at this point in the history
  • Loading branch information
noomorph committed Nov 27, 2020
1 parent 5f07132 commit 4966f94
Show file tree
Hide file tree
Showing 7 changed files with 13 additions and 6 deletions.
4 changes: 3 additions & 1 deletion detox/local-cli/templates/firstTestContent.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
const firstTestContent = `describe('Example', () => {
beforeAll(async () => {
await device.relaunchApp();
await device.launchApp({
newInstance: true,
});
});
beforeEach(async () => {
Expand Down
3 changes: 3 additions & 0 deletions detox/src/devices/Device.js
Original file line number Diff line number Diff line change
Expand Up @@ -131,6 +131,9 @@ class Device {
return (paramsCounter === 1);
}

/**
* @deprecated
*/
async relaunchApp(params = {}, bundleId) {
if (params.newInstance === undefined) {
params['newInstance'] = true;
Expand Down
4 changes: 3 additions & 1 deletion detox/test/e2e/setup.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
const { device } = require('detox');

beforeAll(async () => {
await device.relaunchApp();
await device.launchApp({
newInstance: true,
});
});
2 changes: 1 addition & 1 deletion examples/demo-native-ios/e2e/example.spec.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
describe('Example', () => {
beforeEach(async () => {
await device.relaunchApp();
await device.launchApp({ newInstance: true });
});

it('should have welcome screen', async () => {
Expand Down
2 changes: 1 addition & 1 deletion examples/demo-plugin/e2e/app-hello.test.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
describe('Example (hello)', () => {
beforeAll(() => {
await device.relaunchApp();
await device.launchApp({ newInstance: true });
});

it('should have welcome', async () => {
Expand Down
2 changes: 1 addition & 1 deletion examples/demo-react-native-jest/e2e/setup.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
beforeAll(async () => {
await device.relaunchApp();
await device.launchApp({ newInstance: true });
});
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ const {device, expect, element, by, waitFor} = require('detox');

describe('Example (explicit)', () => {
beforeAll(async () => {
await device.relaunchApp();
await device.launchApp({ newInstance: true });
});

beforeEach(async () => {
Expand Down

0 comments on commit 4966f94

Please sign in to comment.