DenoDDeno
Powered by
YuY
Denoβ€’11mo ago
Yu

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) => {}
    })
  })
};
Deno banner
DenoJoin
Chat about Deno, a modern runtime for JavaScript and TypeScript.
20,934Members
Resources
Recent Announcements

Similar Threads

Was this page helpful?

Similar Threads

Problems with Nested deno.json in Deno Workspaces
staytuned_teamSstaytuned_team / help
12mo ago
How to resolve an import statement in Deno
MelodyMakerMMelodyMaker / help
2y ago
Deno Monorepo with nested applications and packages
NatdmNNatdm / help
11mo ago