diff --git a/test/migration-createAsset.test.ts b/test/migration-createAsset.test.ts index 7cc8e41a..eade34de 100644 --- a/test/migration-createAsset.test.ts +++ b/test/migration-createAsset.test.ts @@ -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() diff --git a/test/writeClient-createAsset.test.ts b/test/writeClient-createAsset.test.ts index 3fa8d41a..34eaabf8 100644 --- a/test/writeClient-createAsset.test.ts +++ b/test/writeClient-createAsset.test.ts @@ -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" @@ -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 })