Skip to content

include firebase/admin with 'import' instead of 'require' #144

@xd2

Description

@xd2

Summary

Would prefer import admin from 'firebase-admin' syntax instead of require('firebase-admin')

Relevant information

Including sdk with require('firebase-admin') syntax seems mandatory (regarding docs, sample and my own experience) to make firestore mock work.
Otherwise, the firestore mock is not initialised properly and the tests crash at the first collection call.

As moderns Typescript coders, my team and I would prefer a proper import admin from 'firebase-admin') style of include.
Is there a way to initialize the test, mocks etc properly without that ugly require thing ?
Even adding a jest.mock(admin.firestore...) or something would be more acceptable to us.

You guys did a great job, by the way ;-)

Environment (if relevant)

I can provide test sample if needed, but i gess my question is quite self explanatory.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions