Closed MiSchroe closed 3 months ago
I think wiping the test directory is not desired, since this will also cause js-controller and admin to be reinstalled, which takes time. Some thoughts, since I've been recently noticing similar behavior in a different situation:
--cache=/some/random/empty/dir
does not help if the path to the tarball matches the one in package-lock.json
.--prefer-online
to the install command might work, but I expect it not to (same path to the tarball).--preserveSymlinks
and --preserveSymlinksMain
).npm update
does the trick and automatically runs an install
if the package is not installed. I have provided a pull request.
Huh, good find!
Description of the issue
Expected behaviour
As a developer I would like to run an integration test against a real js-controller to check that my adapter starts successfully and eventually I would like to add some additional tests using the
defineAdditionalTests
method. Eventually, some of these tests may fail.Eventually, I would like to modify my source code to fix those bugs and re-run the integration tests. Now, the tests will pass.
Actual behaviour
Even after fixing the bugs the tests will still fail, because my changes won't be copied to the node_modules folder in the temp folder of the integration test. See also the discussion at https://discord.com/channels/743167951875604501/743171252377616476/1263559755025223841 (in German language)
Steps to reproduce
Further analysis of the issue
I have debugged the adapterSetup.ts and also the
npm install
process.The following lines are deleting the folder of the adapter in the node_modules folder: https://github.com/ioBroker/testing/blob/58c0bc073230c31060c39c6df19ae6b9d557c8c2/src/tests/integration/lib/adapterSetup.ts#L98-L100
Unfortunately, this is not enough. Probably during
npm pack
ornpm install
the package is saved to the local cache inC:\Users\myusername\AppData\Local\npm-cache\_cacache
(on a Windows machine, on Linux there will be some other path). On the next run ofnpm install
- even with a changed tarball - the cached version is used.