Skip to content
Open
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
13 changes: 12 additions & 1 deletion jest.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,16 +19,27 @@
//

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"]>> = {
modulePathIgnorePatterns: ["dist/", "<rootDir>/examples/"],
setupFilesAfterEnv: ["<rootDir>/jest.setup.ts"],
testRegex: "/src/.*\\.test\\.ts$",
clearMocks: true,
injectGlobals: false,
preset: "ts-jest",
transform: {
...defaultPreset.transform,
// [\\\\/] expands to [\\/], which makes the regex Windows-compatible.
"node_modules[\\\\/]uuid.+\\.js$": [
"ts-jest",
{ tsconfig: { allowJs: true } },
],
},
transformIgnorePatterns: ["node_modules[\\\\/](?!uuid)"],
};

export default {
Expand Down
59 changes: 50 additions & 9 deletions package-lock.json

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

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -204,7 +204,7 @@
"jsonld-context-parser": "^3.0.0",
"jsonld-streaming-parser": "^5.0.0",
"n3": "^1.17.2",
"uuid": "^11.0.1"
"uuid": "^14.0.0"
},
"engines": {
"node": "^20.0.0 || ^22.0.0 || ^24.0.0"
Expand Down
2 changes: 2 additions & 0 deletions src/thing/thing.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,8 @@
// SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
//

// The following module is present but ESM-only, which seems to confuse ESLint.
// eslint-disable-next-line import/no-unresolved
import { v4 as uuidv4 } from "uuid";
import {
isNamedNode,
Expand Down
Loading