Come for the products,
stay for the community

The Atlassian Community can help you and your team get more value out of Atlassian products and practices.

Atlassian Community about banner
4,295,937
Community Members
 
Community Events
165
Community Groups

Can't find a root directory while resolving a config file path on Jest tests.

Edited

On test pipeline using default bitbucket-pipelines.yml i'm getting the following error:

 

Error: Can't find a root directory while resolving a config file path.
Provided path to resolve: test/config.json


What could I do?

2 answers

1 accepted

0 votes
Answer accepted

Solved. It was a mistake.

What was the mistake? I'm likely making the same one :)

Ya, post the solution. I'm hitting this error. I added a file to the list of setupFilesAfterEnv and now running into this

The file exists. I can't see any obvious link between adding a file to this config entry and suddenly not being able to determine the root dir

This project is from years ago. Seeing the only project that runs jest I needed to set --config flag on the npm test task. In that case, this points to test/config.json.

Running it I don't see any problem.

@Declan Shanaghymaybe seting the --config option solved the issue. If you have any problems after this, try open an issue.

Thx. I do have the `--config` option set. Must be something else :-(

The silly mistake I was making was feeding in `--config jest.config.json` when my config file was actually js. Worth checking if google brought you here ;)

Suggest an answer

Log in or Sign up to answer
TAGS
Community showcase
Published in Bitbucket

Git push size limits are coming to Bitbucket Cloud starting April 4th, 2022

Beginning on April 4th, we will be implementing push limits. This means that your push cannot be completed if it is over 3.5 GB. If you do attempt to complete a push that is over 3.5 GB, it will fail...

2,170 views 2 9
Read article

Community Events

Connect with like-minded Atlassian users at free events near you!

Find an event

Connect with like-minded Atlassian users at free events near you!

Unfortunately there are no Community Events near you at the moment.

Host an event

You're one step closer to meeting fellow Atlassian users at your local event. Learn more about Community Events

Events near you