Skip to content

automated-testing with jasmine / detox #35

@wolverineks

Description

@wolverineks

Feature Request

automated-testing with jasmine / detox

Why it is needed

expo project has 2 apps they use for automated e2e testing, for native changes they use bare-expo and for javascript changes they use test-suite

ive been working on getting this up and running for react-native-camera
react-native-camera/react-native-camera#2760

is there any interest in adding something like this to the bob template?

Possible implementation

im working on an implementation here

Code sample

i imagine it could something like

import TestSuite from "react-native-test-suite"

...somewhere in the example app
<TestSuite tests={tests} />
...

with a test being written like

const Photos: TestMaker = ({render}) => (tester: Tester) => {
  const {describe, it, expect} = tester;
  const renderCamera = makeRenderCamera(render);

  describe('getAvailablePictureSizes', () => {
    it('should resolve to an array of strings', async () => {
      const camera = await renderCamera();
      const ratios = await camera.getAvailablePictureSizes();

      expect(ratios).toBeInstanceOf(Array);
      expect(ratios.length).toBeGreaterThan(0);
    });
  });
}

and a single detox test that waits for the test suite to complete, then assert that status === "PASSED" or something like that

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions