Estoy tratando de escribir algunas pruebas unitarias usando el emulador de base de fuego. No importa lo que haga, siempre me da este error:
Could not load the default credentials. Browse to https://cloud.google.com/docs/authentication/getting-started for more information. describe('Cloud Functions', function() { let myFunctions: any, adminInitStub: sinon.SinonStub<[options?: admin.AppOptions, name?: string], admin.app.App>; const tester = funcTest(); before(async () => { admin.initializeApp(); adminInitStub = sinon.stub(admin, "initializeApp"); myFunctions = await import("../src/index") }); after(() => { adminInitStub.restore(); tester.cleanup(); }); describe("dbOrderServiceOnCreated", () => { it("should add snapshot successfully", async function() { const wrapped = tester.wrap(myFunctions.dbOrderServiceOnCreated) wrapped(serviceOrderSnap) this.timeout(0); // THIS IS THE PROBLEM const value = await admin.firestore().collection(constants.collectionOrdersService).get(); return chai.assert.equal(value.size, 1); }) }) })