Yu
Yu
DDeno
Created by Yu on 4/29/2025 in #help
How to stub and spy an deep nested object in deno? (Firestore)
Im desperate with deno testing how can I stub a firestore object in deno?
import { assertEquals } from "https://deno.land/std/assert/mod.ts";
import { assertSpyCalls, spy } from "jsr:@std/testing/mock";
import { Stub, stub } from "jsr:@std/testing/mock";
import ApplicationService from "./fake-api-service.ts";
import { Firestore } from "firebase-admin/firestore";

const firestoreMock = {
collection: () => ({
doc: () => ({
set: async (data: any) => {}
})
})
};
import { assertEquals } from "https://deno.land/std/assert/mod.ts";
import { assertSpyCalls, spy } from "jsr:@std/testing/mock";
import { Stub, stub } from "jsr:@std/testing/mock";
import ApplicationService from "./fake-api-service.ts";
import { Firestore } from "firebase-admin/firestore";

const firestoreMock = {
collection: () => ({
doc: () => ({
set: async (data: any) => {}
})
})
};
1 replies