-
Notifications
You must be signed in to change notification settings - Fork 64
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Upgrade oclif to v3 to avoid deprecation warnings #3896
Conversation
error in test might due to this message "(node:2014) MaxListenersExceededWarning: Possible EventEmitter memory leak detected. 11 error listeners added to [Socket]. Use emitter.setMaxListeners() to increase limit" it is close to the admin-server test...which IIRC does start a real server. just a guess |
I've been able to reproduce the test error where jest exits with error code 1 even after all tests pass. Here's what I've found:
|
Codecov Report
@@ Coverage Diff @@
## main #3896 +/- ##
==========================================
- Coverage 64.38% 63.99% -0.40%
==========================================
Files 1004 1005 +1
Lines 29856 29827 -29
Branches 7151 7148 -3
==========================================
- Hits 19224 19087 -137
- Misses 10469 10577 +108
Partials 163 163
... and 1 file with indirect coverage changes 📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more |
I've sort of figured out what's going on with |
awesome, great job tracking down that process.exitCode fix |
I say merge :) the stuff about importing raw png with file loader is interesting in its own right as well, here clearly fighting with the jest config somehow, but the data URIs are fine |
This upgrades our CLI tool to the latest major release of oclif. The changes to the command files were pretty minimal, mostly that
flags
was renamed toFlags
, args have a new format that look more like the flags format, andthis.parse
is now an asynchronous method.What caused some problems is that the tests would no longer run without removing the "fileTransform.js" Jest setup step. This is used to allaw us to import
png
andsvg
files directly in our code. There was only one place in our code this was used, though, and so in this branch I've remove the "fileTransform.js" and encoded thepng
s that were used as data URLs instead.The other odd thing is that if there is an error in the tests, it won't emit a useful error message. I tracked this down to the fact that
process.warn
in Node (which is called in the oclif code) expects an instance of an Error or a string. But instanceof checks often don't work in Jest. Here's an interesting article explaining why: https://backend.cafe/should-you-use-jest-as-a-testing-library. The only thing I can think of to get better error messages would be to run the CLI tests in a different jest command using a different test runner.Fixes #3869