Skip to content

Commit

Permalink
fix tests on old node version
Browse files Browse the repository at this point in the history
  • Loading branch information
lihbr committed Sep 4, 2024
1 parent 97a9e13 commit 58f1765
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 2 deletions.
6 changes: 5 additions & 1 deletion test/migration-createAsset.test.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,13 @@
import { expect, it } from "vitest"
import { it as _it, expect } from "vitest"

import * as prismic from "../src"
import type { Asset } from "../src/types/api/asset/asset"
import { AssetType } from "../src/types/api/asset/asset"

// Skip test on Node 16 and 18
const hasFileConstructor = typeof File === "function"
const it = _it.skipIf(!hasFileConstructor)

it("creates an asset from a url", () => {
const migration = prismic.createMigration()

Expand Down
6 changes: 5 additions & 1 deletion test/writeClient-createAsset.test.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { expect, it } from "vitest"
import { it as _it, expect } from "vitest"

import { createTestWriteClient } from "./__testutils__/createWriteClient"
import { mockPrismicAssetAPI } from "./__testutils__/mockPrismicAssetAPI"
Expand All @@ -7,6 +7,10 @@ import { ForbiddenError } from "../src"
import { UNKNOWN_RATE_LIMIT_DELAY } from "../src/BaseClient"
import type { AssetTag } from "../src/types/api/asset/tag"

// Skip test on Node 16 and 18
const hasFileConstructor = typeof File === "function"
const it = _it.skipIf(!hasFileConstructor)

it.concurrent("creates an asset from string content", async (ctx) => {
const client = createTestWriteClient({ ctx })

Expand Down

0 comments on commit 58f1765

Please sign in to comment.