Skip to content

Commit 77fef15

Browse files
committed
Use getBaseEndpoint function for live tests
1 parent 42f5b96 commit 77fef15

12 files changed

+29
-18
lines changed

tests/live/apiKey.test.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
import { expect, test, describe } from "vitest";
2+
import { getBaseEndpoint } from "./utils.js";
23

3-
const baseEndpoint = `https://core.aws.qa.acmuiuc.org`;
4+
const baseEndpoint = getBaseEndpoint();
45

56
describe("API Key tests", async () => {
67
test("Test that auth is present on routes", { timeout: 10000 }, async () => {

tests/live/documentation.test.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
import { expect, test } from "vitest";
2+
import { getBaseEndpoint } from "./utils.js";
23

3-
const baseEndpoint = `https://core.aws.qa.acmuiuc.org`;
4+
const baseEndpoint = getBaseEndpoint();
45

56
test("Get OpenAPI JSON", async () => {
67
const response = await fetch(`${baseEndpoint}/api/documentation/json`);

tests/live/events.test.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,10 @@ import { expect, test } from "vitest";
22
import { EventsGetResponse } from "../../src/api/routes/events.js";
33
import { createJwt } from "./utils.js";
44
import { describe } from "node:test";
5+
import { getBaseEndpoint } from "./utils.js";
6+
7+
const baseEndpoint = getBaseEndpoint();
58

6-
const baseEndpoint = `https://core.aws.qa.acmuiuc.org`;
79
test("getting events", async () => {
810
const response = await fetch(`${baseEndpoint}/api/v1/events`);
911
expect(response.status).toBe(200);

tests/live/healthz.test.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import { expect, test } from "vitest";
2-
import { InternalServerError } from "../../src/common/errors/index.js";
2+
import { getBaseEndpoint } from "./utils.js";
33

4-
const baseEndpoint = `https://core.aws.qa.acmuiuc.org`;
4+
const baseEndpoint = getBaseEndpoint();
55

66
test("healthz", async () => {
77
const response = await fetch(`${baseEndpoint}/api/v1/healthz`);

tests/live/iam.test.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,9 @@ import {
55
GroupMemberGetResponse,
66
} from "../../src/common/types/iam.js";
77
import { allAppRoles, AppRoles } from "../../src/common/roles.js";
8+
import { getBaseEndpoint } from "./utils.js";
89

9-
const baseEndpoint = `https://core.aws.qa.acmuiuc.org`;
10+
const baseEndpoint = getBaseEndpoint();
1011
test("getting members of a group", async () => {
1112
const token = await createJwt();
1213
const response = await fetch(

tests/live/ical.test.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
11
import { describe, expect, test } from "vitest";
22
import { CoreOrganizationList } from "@acm-uiuc/js-shared";
33
import ical from "node-ical";
4-
const baseEndpoint = `https://core.aws.qa.acmuiuc.org`;
4+
import { getBaseEndpoint } from "./utils.js";
5+
const baseEndpoint = getBaseEndpoint();
56

67
const delay = (ms: number) => new Promise((resolve) => setTimeout(resolve, ms));
78

tests/live/membership.test.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
import { expect, test, describe } from "vitest";
2+
import { getBaseEndpoint } from "./utils.js";
23

3-
const baseEndpoint = `https://core.aws.qa.acmuiuc.org`;
4+
const baseEndpoint = getBaseEndpoint();
45

56
describe("Membership API basic checks", async () => {
67
test("Test that getting member succeeds", { timeout: 3000 }, async () => {

tests/live/mobileWallet.test.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
import { expect, test, describe } from "vitest";
2+
import { getBaseEndpoint } from "./utils.js";
23

3-
const baseEndpoint = `https://core.aws.qa.acmuiuc.org`;
4+
const baseEndpoint = getBaseEndpoint();
45

56
describe("Mobile pass issuance", async () => {
67
test(

tests/live/organizations.test.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import { expect, test } from "vitest";
2-
import { InternalServerError } from "../../src/common/errors/index.js";
2+
import { getBaseEndpoint } from "./utils.js";
33

4-
const baseEndpoint = `https://core.aws.qa.acmuiuc.org`;
4+
const baseEndpoint = getBaseEndpoint();
55

66
test("getting organizations", async () => {
77
const response = await fetch(`${baseEndpoint}/api/v1/organizations`);

tests/live/protected.test.ts

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,9 @@
11
import { expect, test, describe } from "vitest";
2-
import { createJwt } from "./utils";
3-
import { allAppRoles } from "../../src/common/roles";
2+
import { createJwt } from "./utils.js";
3+
import { allAppRoles } from "../../src/common/roles.js";
4+
import { getBaseEndpoint } from "./utils.js";
45

5-
const baseEndpoint = `https://core.aws.qa.acmuiuc.org`;
6+
const baseEndpoint = getBaseEndpoint();
67

78
describe("Role checking live API tests", async () => {
89
const token = await createJwt();

0 commit comments

Comments
 (0)