Skip to content

fix(test): add JSON import attributes - #595

Merged
di-sukharev merged 2 commits into
di-sukharev:masterfrom
dmaks-alt:master
Nov 1, 2026
Merged

di-sukharev merged 2 commits into
di-sukharev:masterfrom
dmaks-alt:master

Conversation

@dmaks-alt

Copy link
Copy Markdown
Contributor

Summary

Add with { type: 'json' } to JSON imports in source and tests.

This removes Jest 30 deprecation warnings. JSON imports without an attribute
will become errors in a future Jest major release.

Jest: importing JSON without an import attribute is deprecated and will be a hard error in the next major. Update the import of "/home/dmaks/opencommit/node_modules/@dqbd/tiktoken/encoders/cl100k_base.json" (from /home/dmaks/opencommit/test/unit/tokenCount.test.ts): use `with { type: 'json' }` for static imports, or pass `{ with: { type: 'json' } }` as the second argument to dynamic `import()`.

Testing

  • npm run build
  • npm test -- --runInBand --no-cache

@di-sukharev

Copy link
Copy Markdown
Owner

npm run format:check now fails on all seven changed files because prettier 2.8 cannot parse import attributes. please update the formatter and lockfile so this syntax passes ci.

@di-sukharev di-sukharev left a comment

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

updated prettier and the lockfile; all local and github checks pass.

@di-sukharev
di-sukharev merged commit efb98ed into di-sukharev:master Nov 1, 2026
5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants