Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

cleanup #659

Merged
merged 3 commits into from
Dec 10, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2,119 changes: 1,251 additions & 868 deletions examples/ent-rsvp/backend/package-lock.json

Large diffs are not rendered by default.

6 changes: 3 additions & 3 deletions examples/ent-rsvp/backend/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
"dependencies": {
"@sentry/node": "^6.3.0",
"@sentry/tracing": "^6.3.0",
"@snowtop/ent": "^0.0.28-alpha.2",
"@snowtop/ent": "^0.0.28",
"@snowtop/ent-email": "0.0.1",
"@snowtop/ent-passport": "0.0.1",
"@snowtop/ent-password": "0.0.1",
Expand All @@ -54,9 +54,9 @@
"@types/luxon": "^2.0.4",
"@types/passport": "^1.0.7",
"@types/supertest": "^2.0.11",
"jest": "^27.1.1",
"jest": "^27.4.3",
"jest-expect-message": "^1.0.2",
"ts-jest": "^27.0.5",
"ts-jest": "^27.1.0",
"tsconfig-paths": "^3.11.0"
}
}
4 changes: 2 additions & 2 deletions examples/ent-rsvp/backend/src/ent/tests/event.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ describe("create event", () => {
await CreateEventAction.create(new LoggedOutViewer(), {
name: `${user.firstName}'s wedding`,
}).saveX();
fail("should have thrown");
throw new Error("should have thrown");
} catch (e) {
expect((e as Error).message).toMatch(
/Logged out Viewer does not have permission to create Event/,
Expand Down Expand Up @@ -69,7 +69,7 @@ describe("create event", () => {
const activity = activities.find((a) => a.name == "closing brunch");
expect(activity).toBeDefined();
if (!activity) {
fail("impossicant");
throw new Error("impossicant");
}
const address = await Address.loadFromOwnerID(activity.viewer, activity.id);
expect(address).not.toBe(null);
Expand Down
16 changes: 8 additions & 8 deletions examples/ent-rsvp/backend/src/ent/tests/event_activity.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ describe("create event activity", () => {
name: "welcome dinner",
eventID: event.id,
}).saveX();
fail("should have thrown");
throw new Error("should have thrown");
} catch (e) {
expect((e as Error).message).toMatch(
/Viewer with ID (.+) does not have permission to create EventActivity/,
Expand Down Expand Up @@ -93,7 +93,7 @@ describe("load activity", () => {
]);
try {
await EventActivity.loadX(new IDViewer(user.id), activity.id);
fail("should have thrown");
throw new Error("should have thrown");
} catch (e) {
expect((e as Error).message).toMatch(
/^ent (.+) is not visible for privacy reasons$/,
Expand Down Expand Up @@ -123,7 +123,7 @@ describe("invites", () => {
activity.id,
group.id,
);
fail("should have thrown");
throw new Error("should have thrown");
} catch (e) {
expect((e as Error).message).toMatch(
/^ent (.+) is not visible for privacy reasons$/,
Expand All @@ -148,7 +148,7 @@ describe("invites", () => {
activity2.id,
group.id,
);
fail("should have thrown");
throw new Error("should have thrown");
} catch (e) {
expect((e as Error).message).toMatch(
/Viewer with ID (.+) does not have permission to edit EventActivity/,
Expand Down Expand Up @@ -187,7 +187,7 @@ describe("invites", () => {
activity.id,
group.id,
);
fail("should have thrown");
throw new Error("should have thrown");
} catch (e) {
expect((e as Error).message).toMatch(
/^ent (.+) is not visible for privacy reasons$/,
Expand All @@ -209,7 +209,7 @@ describe("invites", () => {
activity.id,
group2.id,
);
fail("should have thrown");
throw new Error("should have thrown");
} catch (e) {
expect((e as Error).message).toMatch(
/Viewer with ID (.+) does not have permission to edit EventActivity/,
Expand Down Expand Up @@ -510,7 +510,7 @@ describe("rsvps", () => {
rsvpStatus: EventActivityRsvpStatusInput.Attending,
},
);
fail("should have thrown");
throw new Error("should have thrown");
} catch (e) {
expect((e as Error).message).toMatch(
/^ent (.+) is not visible for privacy reasons$/,
Expand Down Expand Up @@ -540,7 +540,7 @@ describe("rsvps", () => {
rsvpStatus: EventActivityRsvpStatusInput.Attending,
},
);
fail("should have thrown");
throw new Error("should have thrown");
} catch (e) {
expect((e as Error).message).toMatch(
/^ent (.+) is not visible for privacy reasons$/,
Expand Down
4 changes: 2 additions & 2 deletions examples/ent-rsvp/backend/src/ent/tests/guest.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -91,14 +91,14 @@ test("create guests", async () => {
expect(guest).toBeInstanceOf(Guest);

if (!guest) {
fail("impossicant");
throw new Error("impossicant");
}

const code = await AuthCode.loadFromGuestID(guest.viewer, guest.id);
expect(code).toBeInstanceOf(AuthCode);

if (!code) {
fail("impossicant");
throw new Error("impossicant");
}
expect(code.emailAddress).toBe(guest.emailAddress);
expect(code.guestID).toBe(guest.id);
Expand Down
8 changes: 4 additions & 4 deletions examples/ent-rsvp/backend/src/ent/tests/guest_group.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ describe("create guest group", () => {
invitationName: "people",
eventID: event.id,
}).saveX();
fail("should have thrown");
throw new Error("should have thrown");
} catch (e) {
expect((e as Error).message).toMatch(
/Viewer with ID (.+) does not have permission to create GuestGroup/,
Expand Down Expand Up @@ -112,7 +112,7 @@ test("load guest group", async () => {

try {
await GuestGroup.loadX(new IDViewer(user.id), guestGroup.id);
fail("should have thrown");
throw new Error("should have thrown");
} catch (e) {
expect((e as Error).message).toMatch(
/^ent (.+) is not visible for privacy reasons$/,
Expand All @@ -135,7 +135,7 @@ describe("edit guest group", () => {
await EditGuestGroupAction.create(new IDViewer(user.id), group, {
invitationName: "foo",
}).saveX();
fail("should have thrown");
throw new Error("should have thrown");
} catch (e) {
expect((e as Error).message).toMatch(
/Viewer with ID (.+) does not have permission to edit GuestGroup/,
Expand All @@ -156,7 +156,7 @@ describe("delete guest group", () => {
const [group, user] = await Promise.all([createGuestGroup(), createUser()]);
try {
await DeleteGuestGroupAction.create(new IDViewer(user.id), group).saveX();
fail("should have thrown");
throw new Error("should have thrown");
} catch (e) {
expect((e as Error).message).toMatch(
/Viewer with ID (.+) does not have permission to delete GuestGroup/,
Expand Down
Loading