We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
working
import "mocha"; import { expect } from "chai"; import { set, db } from "../src/firebasekick"; import * as sinon from "sinon"; import * as firebase from "@firebase/testing"; import admin from "firebase-admin"; import DocumentReference = admin.firestore.DocumentReference; import DocumentData = admin.firestore.DocumentData; // stub(obj, 'meth').callsFake(fn) const MY_PROJECT_ID = "septapig"; function getDBadmin(): firebase.firestore.Firestore { return firebase .initializeAdminApp({ projectId: MY_PROJECT_ID, }) .firestore(); } function s(path: string): DocumentReference<DocumentData> | any { const mdb = getDBadmin(); console.log("path:", path); // return mdb.doc("zz/b"); return mdb.doc(path); } describe.skip("mock ...", function () { beforeEach(async function () { sinon.stub(db, "doc").callsFake(s); }); afterEach(function () { // Cancel snapshot listener }); it("Test snapshot listener", async function () { //const path = "test/express/task/0"; const path = "test/0"; const data = { a: "one", time: new Date(), minutes: 35 }; await set(path, data); const testQuery = db.doc(path); await firebase.assertSucceeds(testQuery.get()); }); });
The text was updated successfully, but these errors were encountered:
mchirico, Thanks for opening this issue!
Sorry, something went wrong.
No branches or pull requests
working
The text was updated successfully, but these errors were encountered: