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
20 changes: 19 additions & 1 deletion jest.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,12 @@
//

import type { Config } from "jest";
import { createDefaultPreset } from "ts-jest";

type ArrayElement<MyArray> = MyArray extends Array<infer T> ? T : never;

const defaultPreset = createDefaultPreset();

const baseConfig: ArrayElement<NonNullable<Config["projects"]>> = {
coveragePathIgnorePatterns: [".*\\.mock\\.ts"],
modulePathIgnorePatterns: ["dist/", "<rootDir>/examples/"],
Expand All @@ -33,7 +36,22 @@ const baseConfig: ArrayElement<NonNullable<Config["projects"]>> = {
testRegex: "/src/.*\\.test\\.ts$",
clearMocks: true,
injectGlobals: false,
preset: "ts-jest",
transform: {
...defaultPreset.transform,
// [\\\\/] expands to [\\/], which makes the regex Windows-compatible.
// jose v6 ships as ESM only, and may be nested in a dependency's own
// node_modules (e.g. @inrupt/internal-test-env), so match it anywhere.
"node_modules[\\\\/](uuid|.*jose).+\\.js$": [
"ts-jest",
{ tsconfig: { allowJs: true } },
],
},
// Ignore everything under node_modules except uuid and jose (the latter
// possibly nested in another package's node_modules), which ship ESM that
// must be transpiled before Jest can parse it.
transformIgnorePatterns: [
"node_modules[\\\\/](?!(.*[\\\\/])?(uuid|jose)[\\\\/])",
],
};

export default {
Expand Down
209 changes: 81 additions & 128 deletions package-lock.json

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

6 changes: 3 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -44,11 +44,11 @@
"url": "https://github.com/inrupt/solid-client-errors-js.git"
},
"devDependencies": {
"@inrupt/base-rollup-config": "^4.0.4",
"@inrupt/base-rollup-config": "^4.1.3",
"@inrupt/eslint-config-base": "^4.1.2",
"@inrupt/internal-playwright-helpers": "^4.1.2",
"@inrupt/internal-test-env": "^4.1.2",
"@inrupt/jest-jsdom-polyfills": "^4.1.2",
"@inrupt/internal-test-env": "^4.1.3",
"@inrupt/jest-jsdom-polyfills": "^4.1.3",
"@playwright/test": "^1.61.0",
"@typhonjs-typedoc/ts-lib-docs": "^2024.12.25",
"dotenv": "^17.4.2",
Expand Down