On 2/28/22 3:01 PM, Jonas Smedegaard wrote:
Currently, autopkgtest fails for node-eslint-visitor-keys and I cannot
figure out why.

I would be happy if others could have a look and maybe help spot why it
fails.
[...]

Error: Cannot find module 
'/tmp/autopkgtest-lxc.w0404gv_/downtmp/build.H9q/src/dist/eslint-visitor-keys.cjs'
     at createEsmNotFoundErr (internal/modules/cjs/loader.js:842:15)
     at finalizeEsmResolution (internal/modules/cjs/loader.js:835:15)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

As you might have noticed above, it tries to find dist/<something> in the local 
autopkgtest directory
instead of global one (/usr/share/)

This happens because you are running the test in the same directory where your 
source code is and
the "local" package.json is interfering with your "require" command.

Simple solution is to create a temporary dir; or use $AUTOPKGTEST_TMP (latter 
is best)

I have attached a patch that fixes this, please apply and upload.

Hope that helps.

The package does _not_ use pkg-js-tools.

Had you used this, it'd have passed since it does the change to
temp dir thing by default

Works fine interactively in a local pristine chroot with only nodejs and
node-eslint-visitor-keys installed.

I hope you run the autopkgtest in a schroot/container and were able to 
reproduce it?
diff --git a/debian/tests/control b/debian/tests/control
index b79f387..62d654b 100644
--- a/debian/tests/control
+++ b/debian/tests/control
@@ -1,4 +1,4 @@
-Test-Command: node -e "require('eslint-visitor-keys');"
+Test-Command: cd $AUTOPKGTEST_TMP && node -e "require('eslint-visitor-keys');"
 Depends:
  node-eslint-visitor-keys,
  nodejs,

Attachment: OpenPGP_signature
Description: OpenPGP digital signature

-- 
Pkg-javascript-devel mailing list
[email protected]
https://alioth-lists.debian.net/cgi-bin/mailman/listinfo/pkg-javascript-devel

Reply via email to