Open biancode opened 3 years ago
The latest version of read-pkg-up
is 7.0.1, which is the version this module uses, returns packageJson
, not pkg
.
I seem to remember the module did use to return pkg
- but that changed a while ago.
Checking the release history, read-pkg-up@5.0
and earlier would return pkg
. In v6.0 they changed that to package
, before changing it again to packageJson
with the 7.0 release.
That is correct. Hm. The installed helper has 7.0.1 and that has a dependency to 5.2.0. The helper got the packages installed in its own node_modules, but if I use jest for testing it gets the old version by require() from an older package version, which is installed in the main node_modules from another package in that project that I tried to test. Interesting. It was a very fresh installation. I'll try to refresh the project to test it again.
maybe it is a Jest problem - very fresh install via npm after cache verify etc. - same problem
● Test suite failed to run
TypeError: Cannot read property 'name' of undefined
19 | var serverCmdNodes = [injectNode, functionNode, serverCmdNode]
20 |
> 21 | var helper = require('node-red-node-test-helper')
| ^
22 | helper.init(require.resolve('node-red'))
at findRuntimePath (node_modules/node-red-node-test-helper/index.js:40:27)
at NodeTestHelper.init (node_modules/node-red-node-test-helper/index.js:146:38)
at new NodeTestHelper (node_modules/node-red-node-test-helper/index.js:84:14)
at Object.<anonymous> (node_modules/node-red-node-test-helper/index.js:352:18)
const upPkg = readPkgUp.sync();
// case 1: we're in NR itself
if (upPkg.packageJson|(Cursor is here).name === 'node-red') {
upPkg.packageJson.name changed to upPkg.pkg.name
old:
new: