Skip to content

Commit

Permalink
Revert "separate out event type with auth context"
Browse files Browse the repository at this point in the history
This reverts commit aa8df0f.
  • Loading branch information
blidd-google committed Apr 3, 2024
1 parent 92853d5 commit 8c83dd8
Show file tree
Hide file tree
Showing 2 changed files with 34 additions and 209 deletions.
68 changes: 0 additions & 68 deletions spec/v2/providers/firestore.spec.ts
Expand Up @@ -558,23 +558,6 @@ describe("firestore", () => {
expect(func.run(true as any)).to.eq(2);
expect(func.__endpoint).to.deep.eq(expectedEp);
});

it("calls init function", async () => {
const event: firestore.RawFirestoreEvent = {
...eventBase,
datacontenttype: "application/json",
data: {
oldValue: null,
value: null,
},
};

let hello;
onInit(() => (hello = "world"));
expect(hello).to.be.undefined;
await firestore.onDocumentWrittenWithAuthContext("path", () => null)(event);
expect(hello).to.equal("world");
});
});

describe("onDocumentCreatedWithAuthContext", () => {
Expand Down Expand Up @@ -622,23 +605,6 @@ describe("firestore", () => {
expect(func.run(true as any)).to.eq(2);
expect(func.__endpoint).to.deep.eq(expectedEp);
});

it("calls init function", async () => {
const event: firestore.RawFirestoreEvent = {
...eventBase,
datacontenttype: "application/json",
data: {
oldValue: null,
value: null,
},
};

let hello;
onInit(() => (hello = "world"));
expect(hello).to.be.undefined;
await firestore.onDocumentCreatedWithAuthContext("path", () => null)(event);
expect(hello).to.equal("world");
});
});

describe("onDocumentUpdatedWithAuthContext", () => {
Expand Down Expand Up @@ -686,23 +652,6 @@ describe("firestore", () => {
expect(func.run(true as any)).to.eq(2);
expect(func.__endpoint).to.deep.eq(expectedEp);
});

it("calls init function", async () => {
const event: firestore.RawFirestoreEvent = {
...eventBase,
datacontenttype: "application/json",
data: {
oldValue: null,
value: null,
},
};

let hello;
onInit(() => (hello = "world"));
expect(hello).to.be.undefined;
await firestore.onDocumentUpdatedWithAuthContext("path", () => null)(event);
expect(hello).to.equal("world");
});
});

describe("onDocumentDeletedWithAuthContext", () => {
Expand Down Expand Up @@ -750,23 +699,6 @@ describe("firestore", () => {
expect(func.run(true as any)).to.eq(2);
expect(func.__endpoint).to.deep.eq(expectedEp);
});

it("calls init function", async () => {
const event: firestore.RawFirestoreEvent = {
...eventBase,
datacontenttype: "application/json",
data: {
oldValue: null,
value: null,
},
};

let hello;
onInit(() => (hello = "world"));
expect(hello).to.be.undefined;
await firestore.onDocumentDeletedWithAuthContext("path", () => null)(event);
expect(hello).to.equal("world");
});
});

describe("getOpts", () => {
Expand Down

0 comments on commit 8c83dd8

Please sign in to comment.