You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Boilerplate new CRA project and check basic rendering test
npx create-react-app dep-check --template typescript cd dep-check npm i npm run test
All works fine.
Add terra.js dependency
npm i --save @terra-money/terra.js
Modify App.tsx with first example from terra.js Readme
`import React, {useState} from 'react';
import './App.css';
import { LCDClient, Coin } from '@terra-money/terra.js';
const terra = new LCDClient({
URL: 'https://tequila-lcd.terra.dev',
chainID: 'tequila-0004',
});
const App = () => {
const [coins, setCoins] = useState('');
const offerCoin = new Coin('uusd', '1000000');
terra.market.swapRate(offerCoin, 'ukrw').then(c => {
setCoins(`${offerCoin.toString()} can be swapped for ${c.toString()}`);
});
return (
<div>
{coins}
</div>
);
};
export default App;`
Run again basic test:
npm run test
It fails:
FAIL src/App.test.tsx
● Test suite failed to run
Crypto module not found
at node_modules/jscrypto/SHA256.js:1:5962
at Object.9054 (node_modules/jscrypto/SHA256.js:1:6223)
at r (node_modules/jscrypto/SHA256.js:1:6324)
at Object.3354 (node_modules/jscrypto/SHA256.js:1:491)
at r (node_modules/jscrypto/SHA256.js:1:6324)
at Object.7211 (node_modules/jscrypto/SHA256.js:1:2275)
at r (node_modules/jscrypto/SHA256.js:1:6324)
at Object.1868 (node_modules/jscrypto/SHA256.js:1:3145)
at r (node_modules/jscrypto/SHA256.js:1:6324)
at node_modules/jscrypto/SHA256.js:1:6935
at node_modules/jscrypto/SHA256.js:1:8672
at node_modules/jscrypto/SHA256.js:1:8677
at node_modules/jscrypto/SHA256.js:1:173
at Object.<anonymous> (node_modules/jscrypto/SHA256.js:1:366)
at Object.<anonymous> (node_modules/@terra-money/terra.js/src/core/oracle/msgs/MsgExchangeRateVote.ts:1:1)
at Object.<anonymous> (node_modules/@terra-money/terra.js/src/core/oracle/msgs/index.ts:9:1)
at Object.<anonymous> (node_modules/@terra-money/terra.js/src/core/Msg.ts:17:1)
at Object.<anonymous> (node_modules/@terra-money/terra.js/src/core/index.ts:5:1)
at Object.<anonymous> (node_modules/@terra-money/terra.js/src/index.ts:1:1)
at Object.<anonymous> (src/App.tsx:4:1)
at Object.<anonymous> (src/App.test.tsx:3:1)
Is there anyway to disable that module on test level or something? I know that you introduced jscrypto instead of crypto-js, but it seems like this package is a little bit problematic as well.
Will appreciate any possible solutions.
The text was updated successfully, but these errors were encountered:
Mskalba
changed the title
Jest testing: Crypto module not found
[ISSUE] Jest testing: Crypto module not found
Jul 10, 2021
Reproduction steps:
npx create-react-app dep-check --template typescript
cd dep-check
npm i
npm run test
All works fine.
npm i --save @terra-money/terra.js
npm run test
It fails:
Is there anyway to disable that module on test level or something? I know that you introduced jscrypto instead of crypto-js, but it seems like this package is a little bit problematic as well.
Will appreciate any possible solutions.
The text was updated successfully, but these errors were encountered: