Upgrade NPM packages - Phase 1 (Update mocha & migrated to nyc)
- [ ] All tests pass
- [x] I have run
npm run doc
Description
All the packages are outdated of this NodeJS project. So this is my attempt to get all the NPM depedences upgraded, starting with phase 1.
In this phase 1 PR, I focused first of upgrading Mocha. And migrating away from Istanbul to the new nyc command. Which should be compatible.
If you didn't know, instanbul is NOT maintained anymore: https://www.npmjs.com/package/istanbul, but.. nyc is: https://github.com/istanbuljs/nyc
Before update mocha, I got already an error. So if somebody knows how to run your node-telegram-bot-api tests under Linux, let me know. I still get:
(node:35009) [DEP0040] DeprecationWarning: The `punycode` module is deprecated. Please use a userland alternative instead.
(Use `node --trace-deprecation ...` to show where the warning was created)
node:events:498
throw er; // Unhandled 'error' event
^
TypeError [ERR_INVALID_ARG_TYPE]: The "path" argument must be of type string or an instance of Buffer or URL. Received undefined
at Object.open (node:fs:533:10)
at ReadStream._construct (node:internal/fs/streams:72:17)
at constructNT (node:internal/streams/destroy:300:12)
at process.processTicksAndRejections (node:internal/process/task_queues:89:21)
Emitted 'error' event on ReadStream instance at:
at emitErrorNT (node:internal/streams/destroy:170:8)
at emitErrorCloseNT (node:internal/streams/destroy:129:3)
at process.processTicksAndRejections (node:internal/process/task_queues:90:21) {
code: 'ERR_INVALID_ARG_TYPE'
}
Node.js v22.8.0
But expect your pipeline to still succeed.
Hey, i tried to run the test on Fedora and i also got the same errors. I merged the current master branch with this pull request and then ran the test using npm run test
node:events:496
throw er; // Unhandled 'error' event
^
TypeError [ERR_INVALID_ARG_TYPE]: The "path" argument must be of type string or an instance of Buffer or URL. Received undefined
at Object.open (node:fs:534:10)
at ReadStream._construct (node:internal/fs/streams:72:17)
at constructNT (node:internal/streams/destroy:300:12)
at process.processTicksAndRejections (node:internal/process/task_queues:89:21)
Emitted 'error' event on ReadStream instance at:
at emitErrorNT (node:internal/streams/destroy:170:8)
at emitErrorCloseNT (node:internal/streams/destroy:129:3)
at process.processTicksAndRejections (node:internal/process/task_queues:90:21) {
code: 'ERR_INVALID_ARG_TYPE'
}
Node.js v22.16.0
Btw, do you plan to continue this PR? this package depends on a lot of depricated and vulnerable packages and it would be good if we are able to fix it.
No. Nobody responded.