cli
cli copied to clipboard
refactor: switch from mocha and chai to the jest
Description
Switch from mocha and chai to the jest. Simple reason. Mocha and chai (specifically, a ts-node which transpiles code from TS to JS) has a some problems with importing ESM. I found that problems when I started writing tests for https://github.com/asyncapi/cli/pull/347 and new parser uses new module syntaxes.
We still need chai in devDependencies, because @oclif/test uses it underneath.
Related issue(s) See more https://github.com/asyncapi/cli/pull/347
@derberg Done, could you check again? :)
@derberg ping, ping :P
@derberg When I switched to the jest, oclif doesn't recognized errors from stderr but it throws to the stdout, so I log errors by this.logToStderr(${e.name}: ${e.message}); line.
Related to the bump of oclif - I made a bump along with the transition to the jest. Between 1.11 and 1.18 there is nothing big that will cause a breaking change in our cli.
Kudos, SonarCloud Quality Gate passed! 
0 Bugs
0 Vulnerabilities
0 Security Hotspots
0 Code Smells
No Coverage information
0.0% Duplication
/rtm