Files
firebase-sdk-test-admin-issue/hello.test.ts
2020-10-04 00:59:52 +08:00

12 lines
520 B
TypeScript

import * as firebase from '@firebase/rules-unit-testing';
beforeEach(() => firebase.clearFirestoreData({projectId: 'hello'}))
afterAll(() => Promise.all(firebase.apps().map(a => a.delete())))
test('hello', () => {
const db = firebase.initializeTestApp({projectId: 'hello'}).firestore()
const adminDb = firebase.initializeAdminApp({projectId: 'hello'}).firestore()
firebase.assertSucceeds(adminDb.collection('sup').add({hello: 'world'}))
firebase.assertSucceeds(db.collection('hello').add({hello: 'world'}))
})