node-addon-api
node-addon-api copied to clipboard
Testing broken on Node.js main branch
Fails with:
/home/iojs/build/workspace/node-test-node-addon-api-new/nodes/debian10-x64/node-addon-api/test/index.js:93
process.config.target_defaults.default_configuration =
^
TypeError: Cannot assign to read only property 'default_configuration' of object '#<Object>'
at Object.<anonymous> (/home/iojs/build/workspace/node-test-node-addon-api-new/nodes/debian10-x64/node-addon-api/test/index.js:93:54)
at Module._compile (node:internal/modules/cjs/loader:1159:14)
at Module._extensions..js (node:internal/modules/cjs/loader:1213:10)
at Module.load (node:internal/modules/cjs/loader:1037:32)
at Module._load (node:internal/modules/cjs/loader:878:12)
at Function.executeUserEntryPoint [as runMain] (node:internal/modules/run_main:86:12)
at node:internal/main/run_main_module:23:47
Likely related to https://github.com/nodejs/node/commit/e0ab8dd63731d8eb92053776c5160fb190d5aea5
This is the code in the test script
process.config.target_defaults.default_configuration =
fs
.readdirSync(path.join(__dirname, process.env.REL_BUILD_PATH || '', 'build'))
.filter((item) => (item === 'Debug' || item === 'Release'))[0];
I'm going to remove that code so that the ci tests start running again, that will break the ability to run in debug I think, so I'll leave this issue open until we figure that out.
PR https://github.com/nodejs/node-addon-api/pull/1208 to remove and get ci working again.
CI is green again.
Places where we read default_configuration
https://github.com/nodejs/node-addon-api/search?q=default_configuration
@NickNaso is going to work on doing updates the replace the usage of default_configuration in the existing test files.
Discussion around how to choose.
- Command line flag (preferred, by default use Release by default)
- File system check
I'm closing the issue because the PR https://github.com/nodejs/node-addon-api/pull/1226 has been merged.