automated-testing with jasmine / detox
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 https://github.com/react-native-community/react-native-camera/issues/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
Would be great if you can send a PR to add it. I didn't have enough time to set it up.
I would like to take a look on it