Yu
Yu4w ago

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) => {}
})
})
};
0 Replies
No replies yetBe the first to reply to this messageJoin

Did you find this page helpful?