Skip to content

Commit

Permalink
test: set jest-environment as jsdom where Blob is used
Browse files Browse the repository at this point in the history
Jest v27 fails with Blob is not defined error.
Jest docs: https://jestjs.io/docs/configuration#testenvironment-string
  • Loading branch information
trivikr committed Jan 4, 2022
1 parent b938204 commit 1113cff
Show file tree
Hide file tree
Showing 7 changed files with 21 additions and 0 deletions.
3 changes: 3 additions & 0 deletions packages/body-checksum-browser/src/index.spec.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
/**
* @jest-environment jsdom
*/
import { Sha256 } from "@aws-crypto/sha256-js";
import { HttpRequest } from "@aws-sdk/protocol-http";
import { fromUtf8 } from "@aws-sdk/util-utf8-browser";
Expand Down
3 changes: 3 additions & 0 deletions packages/chunked-blob-reader-native/src/index.spec.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
/**
* @jest-environment jsdom
*/
import { blobReader } from "./index";

describe("blobReader", () => {
Expand Down
3 changes: 3 additions & 0 deletions packages/chunked-blob-reader/src/index.spec.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
/**
* @jest-environment jsdom
*/
import { blobReader } from "./index";

describe("blobReader", () => {
Expand Down
3 changes: 3 additions & 0 deletions packages/fetch-http-handler/src/fetch-http-handler.spec.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
/**
* @jest-environment jsdom
*/
import { AbortController } from "@aws-sdk/abort-controller";
import { HttpRequest } from "@aws-sdk/protocol-http";

Expand Down
3 changes: 3 additions & 0 deletions packages/hash-blob-browser/src/index.spec.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
/**
* @jest-environment jsdom
*/
import { Sha256 } from "@aws-crypto/sha256-js";
import { toHex } from "@aws-sdk/util-hex-encoding";

Expand Down
3 changes: 3 additions & 0 deletions packages/util-dynamodb/src/convertToAttr.spec.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
/**
* @jest-environment jsdom
*/
import { AttributeValue } from "@aws-sdk/client-dynamodb";

import { convertToAttr } from "./convertToAttr";
Expand Down
3 changes: 3 additions & 0 deletions packages/util-dynamodb/src/convertToAttrToNative.spec.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
/**
* @jest-environment jsdom
*/
import { convertToAttr } from "./convertToAttr";
import { convertToNative } from "./convertToNative";
import { NativeAttributeValue } from "./models";
Expand Down

0 comments on commit 1113cff

Please sign in to comment.