web3-onboard
web3-onboard copied to clipboard
[Feature]: Transpile with babel
Is your request related to a problem?
Hello and thank you for great library!
not able to run a tests
Feature Description
maybe you could transpile assets with babel to get rid of ES6 syntax (which is not supported by Jest/NodeJS)
Alternative Solutions
No response
Anything else?
https://github.com/prepo-io/prepo-monorepo/tree/feat/onboard_wallets this is our public mono-repo steps to reproduce:
- go to
/apps/frontend/core-dapp
- install dependencies
yarn install
- and then
yarn test
Hey @georgesmithishere we're considering this and it's on our list - if you want to make sure it's in sooner than later we urge you to do a PR and add it in.
What is the build env you're using this with?
@georgesmithishere could you try configuring your test env to use Babel?
Closing this issue for now, feel free to reopen if the above suggestion does not help.
Hello!
Is there any news about this? I'm getting also the same error as @georgesmithishere mentioned.
@aaronbarnardsound I tried the workaround you mentioned here but it's still not working: https://github.com/blocknative/web3-onboard/issues/1256#issuecomment-1244789235
Hi! I'm also getting the same error when I'm trying to run jest. I tried the solution @aaronbarnardsound provided and it doesn't work either.
If you can provide any solution for this issue, I would really appreciate it.
my environment:
- Next.js v12.1.0
- React.js v17.0.0
- Jest v27.5.1
my jest config:
const nextJest = require('next/jest');
const { pathsToModuleNameMapper } = require('ts-jest');
const { compilerOptions } = require('./tsconfig.json');
const createJestConfig = nextJest({
dir: './',
});
const customJestConfig = {
setupFilesAfterEnv: ['<rootDir>/jest.setup.js'],
moduleDirectories: ['node_modules', '<rootDir>/'],
testEnvironment: 'jest-environment-jsdom',
moduleNameMapper: {
'^@/(.*)': '<rootDir>/$1',
},
testPathIgnorePatterns: ['/nodule_modules/'],
};
module.exports = createJestConfig(customJestConfig);
Any news on this? I've tried countless solutions, including @aaronbarnardsound , but to no avail.
@aaronbarnardsound @techgangboss we are having the same issue running tests on Jest. It's possible to provide a transpile with babel?
Thanks