MCPcopy Create free account
hub / github.com/firebase/firebase-tools / databaseRemoveTestSuit

Function databaseRemoveTestSuit

src/database/remove.spec.ts:54–88  ·  view source on GitHub ↗
(threshold: number)

Source from the content-addressed store, hash-verified

52 }
53
54 function databaseRemoveTestSuit(threshold: number): void {
55 describe(`DatabaseRemove when largeThreshold=${threshold}`, () => {
56 it("should remove nested tree", async () => {
57 const data = buildData(3, 5);
58 const fakeDb = new FakeRemoveRemote(data, threshold);
59 const fakeLister = new FakeListRemote(data);
60 const removeOps = new DatabaseRemove(
61 "test-nested-tree",
62 "/",
63 HOST,
64 /* disableTriggers= */ false,
65 );
66 removeOps.remote = fakeDb;
67 removeOps.listRemote = fakeLister;
68 await removeOps.execute();
69 expect(fakeDb.data).to.eql(null);
70 });
71
72 it("should remove flat tree when threshold=${threshold}", async () => {
73 const data = buildData(1232, 1);
74 const fakeDb = new FakeRemoveRemote(data, threshold);
75 const fakeList = new FakeListRemote(data);
76 const removeOps = new DatabaseRemove(
77 "test-remover",
78 "/",
79 HOST,
80 /* disableTriggers= */ false,
81 );
82 removeOps.remote = fakeDb;
83 removeOps.listRemote = fakeList;
84 await removeOps.execute();
85 expect(fakeDb.data).to.eql(null);
86 });
87 });
88 }
89
90 databaseRemoveTestSuit(100);
91 databaseRemoveTestSuit(10);

Callers 1

remove.spec.tsFile · 0.85

Calls 2

executeMethod · 0.95
buildDataFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…