Open brodycj opened 5 years ago
The existing test automation which I think needs some formal documentation is intended to ensure that code refactoring and other cleanup does not break working behavior. I generally use snapshots to capture the current behavior, which can be updated according to behavior changes as needed. The automatic testing is in the following parts under the tests
subdirectory:
with-injection
- test behavior with mock objects injected through an undocumented part of the library APIwith-mocks
- test some behavior using some mock Jest objects as needed - especially needed for testing with Windows (using generated uuids) and checking the console logging callsintegration
- test some end-to-end behavior running bin/cli.js
in a separate process, in a very limited number of cases (this is only done to ensure that bin/cli.js
which is now very limited is not broken by refactoring or other code cleanup)Here are the main things that are needed to maintain the automatic testing:
yarn jest -u
or npx jest -u
to update the tests if the behavior or generated output is updatedfs
library may need test updatesI recently introduced Stryker mutation testing which seems to catch most cases of code not covered by the automatic testing (I discussed some exceptions in #89).
Here are some sanity test cases that I run whenever I am ready to publish a new package release, with create-react-native-module
installed using npm i -g github:brodybits/create-react-native-module#mybranchname
:
--view
option) with generated example works on Android & iOS--example-react-native-version=react-native@latest
in this case)(I am starting to skip some of these steps when I feel they are not all needed.)
I generally do similar manual testing, sometimes to a limited extent, before merging significant updates.
Motivation is to avoid making releases with stupid mistakes like #12.
There may be ways to do this automatically, using Sauce Labs for example. I think the existing manual and automatic testing process should be good enough for now (at least).
/cc @dlowder-salesforce @dsyne
In response to discussion in PR #91 (adding tvOS platform support)
/cc @dlowder-salesforce @dsyne