Start with a project whose tests pass
In your repository, add package.json, a small cart.js and its tests in cart.test.js. The tests use node:test, which ships with Node, so there is nothing to download.
Run npm install once. With no dependencies it installs nothing, but it writes package-lock.json, which CI will need.
WHY
CI runs the same command you run. If npm test is not green on your laptop, a pipeline only tells you the same thing more slowly.