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

Tests are only working with npm; failing with yarn #39

Closed
esteblock opened this issue Jul 3, 2023 · 2 comments
Closed

Tests are only working with npm; failing with yarn #39

esteblock opened this issue Jul 3, 2023 · 2 comments
Assignees
Labels
bug Something isn't working

Comments

@esteblock
Copy link
Member

If pakcages are installed with yarn, I get this error:

 yarn test
yarn run v1.22.19
$ npm run test --prefix=./packages/core

> @soroban-react/[email protected] test
> yarn build && yarn jest

$ rm -rf dist
$ yarn prebuild && tsc
$ rm -rf dist
$ /home/wachuma/Blockchain/stellar/esteblock/soroban-react/node_modules/.bin/jest
 FAIL  tests/useSorobanReact.test.js
  ● Test suite failed to run

    Cannot find module 'react' from 'jest.setup.js'

      1 | const { JSDOM } = require('jsdom');
    > 2 | const React = require('react');
        |               ^
      3 | const { useContext } = require('react');
      4 | const { render } = require('react-dom');
      5 | const { renderHook } = require('@testing-library/react-hooks');

      at Resolver._throwModNotFoundError (../../node_modules/jest-resolve/build/resolver.js:427:11)
      at Object.require (jest.setup.js:2:15)

 FAIL  tests/index.test.js
  ● Test suite failed to run

    Cannot find module 'react' from 'jest.setup.js'

      1 | const { JSDOM } = require('jsdom');
    > 2 | const React = require('react');
        |               ^
      3 | const { useContext } = require('react');
      4 | const { render } = require('react-dom');
      5 | const { renderHook } = require('@testing-library/react-hooks');

      at Resolver._throwModNotFoundError (../../node_modules/jest-resolve/build/resolver.js:427:11)
      at Object.require (jest.setup.js:2:15)

 FAIL  tests/SorobanContext.test.js
  ● Test suite failed to run

    Cannot find module 'react' from 'jest.setup.js'

      1 | const { JSDOM } = require('jsdom');
    > 2 | const React = require('react');
        |               ^
      3 | const { useContext } = require('react');
      4 | const { render } = require('react-dom');
      5 | const { renderHook } = require('@testing-library/react-hooks');

      at Resolver._throwModNotFoundError (../../node_modules/jest-resolve/build/resolver.js:427:11)
      at Object.require (jest.setup.js:2:15)
@esteblock
Copy link
Member Author

npm install is also not working?

@esteblock
Copy link
Member Author

Should we be married with only one package manager?

@esteblock esteblock added the bug Something isn't working label Oct 30, 2023
@esteblock esteblock moved this from Next to Todo in @soroban-react & Boilerplate Oct 30, 2023
@chopan123 chopan123 closed this as not planned Won't fix, can't repro, duplicate, stale Jul 30, 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
Projects
Status: Done
Development

No branches or pull requests

3 participants