You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Some of the agent dependencies are moving to ESM exclusively and this presents a new challenge for testing their version using TAV. In this dependabot PR which updates got we faced 2 problems
exports property of the package does not have package.json in it so we are not allowed to require it
we need to use dynamic imports
So we should find an alternative to require to read package.json files and also a way for the test to know when to use require or dynamic imports (if there is no single way of doing it)
# Testing 'got' was initially added to test an issue in its usage of
#[email protected]. However, this test case serves to sanity test 'got'
# usage with the agent. Got@12 is pure ESM, so cannot currently be tested with
# the current test script.
For the "get the version from package.json" error (if I understand it correctly), we have safeGetPackageVersion in _utils.js:
// "Safely" get the version of the given package, if possible. Otherwise return// null.//// Here "safely" means avoiding `require("$packageName/package.json")` because// that can fail if the package uses an old form of "exports"// (e.g. https://github.com/elastic/apm-agent-nodejs/issues/2350).functionsafeGetPackageVersion(packageName){
So we should find an alternative to require to read package.json files and also a way for the test to know when to use require or dynamic imports (if there is no single way of doing it)
Some of the agent dependencies are moving to ESM exclusively and this presents a new challenge for testing their version using
TAV
. In this dependabot PR which updatesgot
we faced 2 problemspackage.json
in it so we are not allowed to require itSo we should find an alternative to
require
to readpackage.json
files and also a way for the test to know when to use require or dynamic imports (if there is no single way of doing it)Note: better to wait until #1952 is completed
The text was updated successfully, but these errors were encountered: