Skip to content

Commit

Permalink
chore: Replace jest with vitest for Hasura introspection tests (#…
Browse files Browse the repository at this point in the history
  • Loading branch information
DafyddLlyr authored Nov 19, 2024
1 parent 9ca8e04 commit 09e201b
Show file tree
Hide file tree
Showing 13 changed files with 663 additions and 2,104 deletions.
1 change: 1 addition & 0 deletions hasura.planx.uk/tests/analytics.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,7 @@ describe("analytics and analytics_logs", () => {
});

describe("api", () => {
let i;
beforeAll(async () => {
i = await introspectAs("api");
});
Expand Down
1 change: 1 addition & 0 deletions hasura.planx.uk/tests/flow_document_templates.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,7 @@ describe("flow_document_templates", () => {
});

describe("api", () => {
let i;
beforeAll(async () => {
i = await introspectAs("api");
});
Expand Down
13 changes: 4 additions & 9 deletions hasura.planx.uk/tests/package.json
Original file line number Diff line number Diff line change
@@ -1,20 +1,15 @@
{
"scripts": {
"test": "echo 'Running hasura tests…' && jest && echo 'Hasura tests passed.'",
"test:watch": "jest --watch",
"test": "echo 'Running hasura tests…' && vitest run && echo 'Hasura tests passed.'",
"test:watch": "vitest watch",
"build-jwt": "DOTENV_CONFIG_PATH=../.env.test node -r dotenv/config scripts/buildJWT.js"
},
"dependencies": {
"dotenv": "^16.4.1",
"isomorphic-fetch": "^3.0.0",
"jest": "^29.7.0",
"jsonwebtoken": "^9.0.1",
"uuid": "^11.0.2"
},
"jest": {
"setupFilesAfterEnv": [
"./jest.setup.js"
]
"uuid": "^11.0.2",
"vitest": "^2.1.5"
},
"pnpm": {
"overrides": {
Expand Down
4 changes: 2 additions & 2 deletions hasura.planx.uk/tests/payment_requests.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -187,7 +187,7 @@ const insertSessions = async (sessionIds) => {
}
`;
const res = await gqlAdmin(query);
ids = res.data.insert_lowcal_sessions.returning.map((row) => row.id);
const ids = res.data.insert_lowcal_sessions.returning.map((row) => row.id);
assert.strictEqual(ids.length, 2);
};

Expand Down Expand Up @@ -224,7 +224,7 @@ const insertPaymentRequests = async (sessionIds, paymentRequestIds) => {
}
`;
const res = await gqlAdmin(query);
ids = res.data.insert_payment_requests.returning.map((row) => row.id);
const ids = res.data.insert_payment_requests.returning.map((row) => row.id);
assert.strictEqual(ids.length, 2);
};

Expand Down
Loading

0 comments on commit 09e201b

Please sign in to comment.