Skip to content

Commit 16662c9

Browse files
Export more functions from the firebase module (#1332)
* Export more functions from the firebase module * [AUTOMATED]: Prettier Code Styling * Remove unnecessary import * Remove console log
1 parent 1fce8f4 commit 16662c9

File tree

2 files changed

+11
-2
lines changed

2 files changed

+11
-2
lines changed

packages/testing/src/api/index.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,8 @@ import * as grpc from 'grpc';
2222
import { resolve } from 'path';
2323
import * as fs from 'fs';
2424

25+
export { database, firestore } from 'firebase';
26+
2527
const PROTO_ROOT = {
2628
root: resolve(
2729
__dirname,

packages/testing/test/database.test.ts

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,6 @@ import * as chai from 'chai';
1818
import * as chaiAsPromised from 'chai-as-promised';
1919
import * as firebase from '../src/api';
2020
import { base64 } from '@firebase/util';
21-
import '@firebase/firestore';
2221

2322
const expect = chai.expect;
2423

@@ -90,7 +89,6 @@ describe('Testing Module Tests', function() {
9089
await expect(firebase.loadDatabaseRules.bind(null, {})).to.throw(
9190
/databaseName not specified/
9291
);
93-
console.log('b');
9492
await expect(firebase.loadDatabaseRules.bind(null, {
9593
databaseName: 'foo'
9694
}) as Promise<void>).to.throw(/must provide rules/);
@@ -124,4 +122,13 @@ describe('Testing Module Tests', function() {
124122
await firebase.initializeTestApp({ databaseName: 'bar', auth: {} });
125123
expect(firebase.apps().length).to.equal(numApps + 2);
126124
});
125+
126+
it('there is a way to get database timestamps', function() {
127+
expect(firebase.database.ServerValue.TIMESTAMP).to.deep.equal({
128+
'.sv': 'timestamp'
129+
});
130+
});
131+
it('there is a way to get firestore timestamps', function() {
132+
expect(firebase.firestore.FieldValue.serverTimestamp()).not.to.be.null;
133+
});
127134
});

0 commit comments

Comments
 (0)