# Can't use fuels in jest tests

**URL:** <https://forum.fuel.network/t/cant-use-fuels-in-jest-tests/2789>\
**Category:** TypeScript SDK\
**Created:** [June 23, 2023, 6:55pm UTC](https://forum.fuel.network/t/cant-use-fuels-in-jest-tests/2789 "2023-06-23T18:55:02Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![sway](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.fuel.network/sway/32/103_2.png) [@sway](https://forum.fuel.network/u/sway)\
**Post date:** [June 23, 2023, 6:55pm UTC](https://forum.fuel.network/t/cant-use-fuels-in-jest-tests/2789/1 "2023-06-23T18:55:02Z")

</div>

Hey guys!

I have been trying to create some test for my app using jest, but it `fuels` imports are failing in test, I am not sure how to fix it, possibly it requires some flag in `jestconfig.json` or some changes in sdk itself, please help me.

Repo link - [https://github.com/compolabs/spark-ts-sdk/blob/v2/tests/creation.test.ts](https://github.com/compolabs/spark-ts-sdk/blob/v2/tests/creation.test.ts)

Test code  
wallet.test.ts

```auto
import { Wallet } from "fuels";

test("create order", () => {
  console.log("create order");
  const wallet = Wallet.generate();
  console.log(wallet);
});

```

Error message:

```auto
   Cannot find module 'fuels' from 'tests/creation.test.ts'

      3 | import BN from "../src/utils/BN";
      4 | import { nodeUrl, privateKey } from "../src/config";
    > 5 | import { Wallet } from "fuels";
        | ^
      6 | 

```

---

<div class="post-metadata">

**Author:** ![danielbate](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.fuel.network/danielbate/32/1617_2.png) [@danielbate](https://forum.fuel.network/u/danielbate)\
**Post date:** [June 24, 2023, 2:09pm UTC](https://forum.fuel.network/t/cant-use-fuels-in-jest-tests/2789/2 "2023-06-24T14:09:34Z")

</div>

Hey @sway! I’m afraid I haven’t been able to recreate your issue. I’ve been able to install `fuels` in a new project with no additional jest config and run your test: [repository](https://github.com/danielbate/fuels-jest-example).

However I also can’t access your repo, `spark-ts-sdk` must be private? I’d be happy to take a look if you are able to replicate it in a new repo or give access to that one?

---

<div class="post-metadata">

**Author:** ![sway](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.fuel.network/sway/32/103_2.png) [@sway](https://forum.fuel.network/u/sway)\
**Post date:** [July 6, 2023, 11:28am UTC](https://forum.fuel.network/t/cant-use-fuels-in-jest-tests/2789/3 "2023-07-06T11:28:41Z")

</div>

> [@danielbate](#):
>
> spark-ts-sdk

My bad, sorry for long reply, now it is public

---

<div class="post-metadata">

**Author:** ![danielbate](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.fuel.network/danielbate/32/1617_2.png) [@danielbate](https://forum.fuel.network/u/danielbate)\
**Post date:** [July 6, 2023, 3:47pm UTC](https://forum.fuel.network/t/cant-use-fuels-in-jest-tests/2789/4 "2023-07-06T15:47:59Z")

</div>

No problem! So I am seeing:

```auto
Test suite failed to run

    src/order.ts:2:49 - error TS2307: Cannot find module './predicates' or its corresponding type declarations.

    2 import { LimitOrderPredicateAbi__factory } from "./predicates";
                                                      ~~~~~~~~~~~~~~
    src/order.ts:3:53 - error TS2307: Cannot find module './predicates/factories/LimitOrderPredicateAbi__factory' or its corresponding type declarations.

    3 import { LimitOrderPredicateAbiConfigurables } from "./predicates/factories/LimitOrderPredicateAbi__factory";

```

I think there must be some autogenerated predicate factories that haven’t been committed to the branch?

---

<div class="post-metadata">

**Author:** ![sandusky](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.fuel.network/sandusky/32/1313_2.png) [@sandusky](https://forum.fuel.network/u/sandusky)\
**Post date:** [July 24, 2023, 2:27pm UTC](https://forum.fuel.network/t/cant-use-fuels-in-jest-tests/2789/5 "2023-07-24T14:27:19Z")

</div>


