Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion jest.config.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
module.exports = {
preset: "ts-jest",
setupFilesAfterEnv: ["<rootDir>/tests/setupFile.js"],
setupFilesAfterEnv: ["<rootDir>/jest.setup.ts"],
clearMocks: true,
injectGlobals: false,
collectCoverage: true,
Expand Down
26 changes: 1 addition & 25 deletions tests/setupFile.js → jest.setup.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,28 +19,4 @@
// SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
//

/* eslint-disable global-require */
/* eslint-disable @typescript-eslint/no-var-requires */

// TextEncoder / TextDecoder APIs are used by Jose, but are not provided by
// jsdom, all node versions supported provide these via the util module
if (
typeof globalThis.TextEncoder === "undefined" ||
typeof globalThis.TextDecoder === "undefined"
) {
const utils = require("util");
globalThis.TextEncoder = utils.TextEncoder;
globalThis.TextDecoder = utils.TextDecoder;
}

// Node.js doesn't support Blob or File, so we're polyfilling those with
// https://github.com/web-std/io
if (typeof globalThis.Blob === "undefined") {
const stdBlob = require("@web-std/blob");
globalThis.Blob = stdBlob.Blob;
}

if (typeof globalThis.File === "undefined") {
const stdFile = require("@web-std/file");
globalThis.File = stdFile.File;
}
import "@inrupt/jest-jsdom-polyfills";
23 changes: 21 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 1 addition & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,7 @@
},
"devDependencies": {
"@inrupt/eslint-config-lib": "^1.0.0",
"@inrupt/jest-jsdom-polyfills": "^1.3.0",
"@inrupt/solid-client-authn-browser": "^1.12.1",
"@inrupt/solid-client-authn-node": "^1.12.1",
"@playwright/test": "^1.23.0",
Expand All @@ -88,8 +89,6 @@
"@types/dotenv-flow": "^3.1.0",
"@types/jest": "^27.4.0",
"@types/parse-link-header": "^2.0.0",
"@web-std/blob": "^3.0.4",
"@web-std/file": "^3.0.2",
"dotenv-flow": "^3.2.0",
"eslint": "^8.18.0",
"jest": "^27.5.1",
Expand Down
3 changes: 2 additions & 1 deletion tsconfig.eslint.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
"src/**/*.test.ts",
"e2e/**/*.ts",
"examples/**/*.ts",
"tests/**/*.js"
"jest.config.ts",
"jest.setup.ts"
]
}