firebase/app#deleteApp TypeScript Examples

The following examples show how to use firebase/app#deleteApp. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: testUtils.ts    From advocacy-maps with MIT License 6 votes vote down vote up
export async function terminateFirebase() {
  await deleteApp(app)
  await terminate(firestore)
  await clearIndexedDbPersistence(firestore)
  // Despite the above calls to teardown firebase resources, Jest still
  // complains about unstopped async operations. Adding a 3 second pause fixes
  // the warning but increases test time. Firebase eventually does exit, but the
  // above promises resolve before that occurs. So just live with the warning
  // and let firebase clean itself up.
  //
  // await new Promise(r => setTimeout(r, 3000))

  // Clean up the admin interface
  admin.firestore().terminate()
}