in Pipeline, Cannot find module '@testing-library/jest-dom' from 'src/setupTests.js'

Loremuel Gadrinab
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
February 9, 2025

Hi, I have issue on running my pipeline. I just added it manually for "Build and test a NodeJs code". when I run it, I got this error. any idea? thanks..

error.png

2 answers

0 votes
Theodora Boudale
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
February 11, 2025

Hi Loremuel and welcome to the community!

Based on the output, this looks like an issue with a specific dependency, https://github.com/testing-library/jest-dom.

Every Pipelines step runs in a Docker container based on the image you have specified in your bitbucket-pipelines.yml file. If you install Docker on your machine, you can follow this guide to debug this Pipelines step locally with Docker:

If you get the same error when following this guide, then the issue is not specific to Pipelines. Perhaps this dependency is missing and you need to install it during the build or it might be another issue with your source code. If you cannot figure it out, you could reach out to the dev team of this extension by raising an issue in their issue tracker here: https://github.com/testing-library/jest-dom/issues.

Kind regards,
Theodora

0 votes
Saxea _Flowie_
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
February 9, 2025

Hi @Loremuel Gadrinab

Is 'npm install' and 'npm test' in different steps? You typically want them in the same step, as part of the script.

Suggest an answer

Log in or Sign up to answer
DEPLOYMENT TYPE
CLOUD
PERMISSIONS LEVEL
Product Admin Site Admin
TAGS
AUG Leaders

Atlassian Community Events