Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

275
Views
TypeError: WalletLib.WalletClient is not a constructor

I'm using a custome SDK in my React Native project and importing it as:

import * as WalletLib from 'wallet-lib';

and then using its sub classes and function like below:

const client = new WalletLib.WalletClient(
  'http://dev-s-wallet.bgdom.com/',
  'https://dev-a-wallet.bgdom.com/',
);

This is working fine for application but when I write test using jest it gives me errors.

Test suite failed to run

TypeError: BoaWallet.WalletClient is not a constructor

   8 | import * as WalletLib from 'wallet-lib';
   9 |
> 10 | const boa_client = new WalletLib.WalletClient(
     |                    ^
  11 |   'http://dev-s-wallet.bgdom.com/',
  12 |   'http://dev-a-wallet.bgdom.com/',
  13 | );

  at Object.<anonymous> (src/utils/bWalletLibCall.js:10:20)
  at Object.<anonymous> (src/screens/authenticated/overviewTabs/PendingTab.js:27:1)

I'm mocking it as below:

jest.mock('wallet-lib', () => {
  return {
    WalletLib: jest.fn().mockImplementation(() => ({
      WalletClient: jest.fn().mockImplementation(() => {
        return {};
      }),
    })),
  };
});

But it still giving me same error. How can I resolve this.

Thank you!

about 4 years ago · Juan Pablo Isaza
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!