Set up an Azure Pipeline for a Next.js project that uses the @sanity/image-url package.
Ensure that the pipeline includes a step to run tests with coverage.
Trigger the pipeline to run the tests.
Expected behavior
The tests should run successfully with coverage reports generated without any file not found errors.
Actual behavior
An error occurs: Error: ENOENT: no such file or directory, open '/home/vsts/work/1/s/node_modules/@sanity/image-url/src/builder.ts'. This issue only happens when running tests with coverage.
Additional context
This issue occurs specifically when running tests with coverage enabled in the Azure Pipeline. The error indicates that Jest is attempting to access the source code of the @sanity/image-url package, which should not be necessary for running tests. This behavior is inconsistent with local test runs, where coverage works without issues. It appears to be related to how the Azure environment handles module resolution or coverage collection.
Version
29.7.0
Steps to reproduce
Expected behavior
Actual behavior
An error occurs: Error: ENOENT: no such file or directory, open '/home/vsts/work/1/s/node_modules/@sanity/image-url/src/builder.ts'. This issue only happens when running tests with coverage.
Additional context
This issue occurs specifically when running tests with coverage enabled in the Azure Pipeline. The error indicates that Jest is attempting to access the source code of the @sanity/image-url package, which should not be necessary for running tests. This behavior is inconsistent with local test runs, where coverage works without issues. It appears to be related to how the Azure environment handles module resolution or coverage collection.
Environment