Skip to content

Commit

Permalink
Add timeout to long-running test
Browse files Browse the repository at this point in the history
  • Loading branch information
david-mears-2 committed Aug 2, 2024
1 parent e00f9b6 commit 31f9b8e
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
2 changes: 2 additions & 0 deletions tests/unit/server/api/rApi.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@ import { fetchRApi } from "@/server/utils/rApi";
// the test server in a Nuxt environment where e.g. Nuxt plugins and imports are available.
// 3. Use a separate service such as Mockoon to run a separate server for the R API, since Nuxt's $fetch function
// cannot be mocked.
// Thus, although the set-up just described is not very unit-like and is more like an integration test, it is
// the closest to unit-testing that the Nuxt eco-system seems to currently offer.

describe("fetchRApi", () => {
it("should make a request to the correct URL when given an endpoint", async () => {
Expand Down
2 changes: 1 addition & 1 deletion tests/unit/server/api/versions.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ beforeAll(async () => {
expect(response?.status).toBe(200);
});

describe("api/versions", async () => {
describe("api/versions", { timeout: 30000 }, async () => {
// Run the setup function to start the Nuxt server
await setup({
runner: "vitest", // this is the default value but I'm just making it explicit
Expand Down

0 comments on commit 31f9b8e

Please sign in to comment.