Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Jest configuration #1366

Open
nickz-t3 opened this issue Mar 28, 2024 · 2 comments
Open

Jest configuration #1366

nickz-t3 opened this issue Mar 28, 2024 · 2 comments
Labels
bug Something isn't working wontfix This will not be worked on

Comments

@nickz-t3
Copy link

nickz-t3 commented Mar 28, 2024

Bug severity
4

Describe the bug
I am trying to integrate Veramo and getting following error upon running jest testing

Warning:  The .env.test file is not located, fallback to default environment configuration
FAIL src/modules/vc_veramo/services/__tests__/issue.unit.spec.ts
  ● Test suite failed to run
    Cannot find module 'uint8arrays' from 'node_modules/@veramo/key-manager/build/key-manager.js'
    Require stack:
      node_modules/@veramo/key-manager/build/key-manager.js
      node_modules/@veramo/key-manager/build/index.js
      src/shared/veramo/setup.ts
      src/modules/vc_veramo/services/__tests__/issue.unit.spec.ts
      17 |
      18 | // Core key manager plugin
    > 19 | import { KeyManager } from '@veramo/key-manager';
         | ^
      20 |
      21 | // Custom key management system for RN
      22 | import { KeyManagementSystem, SecretBox } from '@veramo/kms-local';
      at Resolver._throwModNotFoundError (node_modules/jest-resolve/build/resolver.js:4[27](https://github.com/Terminal-3/t3-backend/actions/runs/8462077353/job/23182863538?pr=413#step:8:28):11)
      at Object.<anonymous> (node_modules/@veramo/key-manager/src/key-manager.ts:21:1)
      at Object.<anonymous> (node_modules/@veramo/key-manager/src/index.ts:7:1)
      at Object.<anonymous> (src/shared/veramo/setup.ts:19:1)
      at Object.<anonymous> (src/modules/vc_veramo/services/__tests__/issue.unit.spec.ts:6:1)

Versions
Node 20.9

Details
I’ve tried:

yarn add uint8arrays
jest.unit.config.ts
moduleNameMapper: {
...
    '^uint8arrays/(.*)$': '<rootDir>/node_modules/uint8arrays/$1',
  },
babel.config.js  
// import assertions
  plugins: [
...
    '@babel/plugin-transform-modules-commonjs',
  ],
};

None of that solves the problem

Any help would be appreciated. Thank you!

@nickz-t3 nickz-t3 added the bug Something isn't working label Mar 28, 2024
@nickreynolds
Copy link
Contributor

We noticed errors related to Jest and uint8arrays after upgrading to ESM, and have dealt with them occasionally when updating dependencies as well.

Could you share a link to your repo so we could help you investigate?

In the meantime, you may want to upgrade your veramo dependencies to version ^6.0.0, so that we're all on the same page.

Copy link

stale bot commented Jun 2, 2024

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

@stale stale bot added the wontfix This will not be worked on label Jun 2, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working wontfix This will not be worked on
Projects
None yet
Development

No branches or pull requests

2 participants