[tests] misc

This commit is contained in:
Salakar 2018-04-12 18:13:40 +01:00
parent 380720c5fe
commit c1abfcf002
3 changed files with 27 additions and 22 deletions

View File

@ -14,27 +14,7 @@
* Run `npm install`.
## To test Release build of your app
### Step 2: Build
* Build the demo project
```sh
detox build --configuration ios.sim.release
```
### Step 3: Test
* Run tests on the demo project
```sh
detox test --configuration ios.sim.release
```
This action will open a new simulator and run the tests on it.
## To test Debug build of your app
## To test build of your app
### Step 2: Build
@ -84,7 +64,9 @@ Error: Failed to parse properties from /Users/mike/.android/avd/Actually_THIS_on
#### Running specific tests
Add a `--grep` to e2e/mocha.opts file, e.g. `--grep auth` for all tests that have auth in the file path or tests descriptions.
Mocha supports the `.only` syntax, e.g. instead of `describe(...) || it(...)` you can use `describe.only(...) || it.only(...)` to only run that specific context or test.
Another way to do this is via adding a `--grep` option to e2e/mocha.opts file, e.g. `--grep auth` for all tests that have auth in the file path or tests descriptions.
#### Running Node debugger

View File

@ -25,6 +25,7 @@ class Root extends Component {
bridge.setBridgeProperty('root', this);
bridge.setBridgeProperty('module', firebase);
bridge.setBridgeProperty('require', require);
}
render() {

View File

@ -4,6 +4,28 @@ describe('firestore()', () => {
await TestHelpers.firestore.resetTestCollectionDoc();
});
describe('id', () => {
it('returns a string document id', async () => {
const { testCollectionDoc, COL_DOC_1_ID } = TestHelpers.firestore;
const snapshot = await testCollectionDoc().get();
snapshot.id.should.be.a.String();
snapshot.id.should.equal(COL_DOC_1_ID);
});
});
describe.only('ref', () => {
it('returns a DocumentReference', async () => {
const { testCollectionDoc } = TestHelpers.firestore;
const snapshot = await testCollectionDoc().get();
// console.dir(bridge.context.require.getModules());
// snapshot.ref.should.be.an.instanceOf(
// bridge.require(
// 'react-native-firebase/dist/modules/firestore/DocumentReference.js'
// )
// );
});
});
describe('get()', () => {
it('using a dot notated path string', async () => {
const { testCollectionDoc } = TestHelpers.firestore;