mirror of
https://github.com/zhigang1992/firebase-sdk-test-admin-issue.git
synced 2026-01-12 22:39:19 +08:00
12 lines
520 B
TypeScript
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'}))
|
|
})
|