Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add test reporter for Kotlin/JS (#3757)
This PR adds test reporter for Kotlin/JS. It is based on [XUnit](https://mochajs.org/#xunit) reporter provided by Mocha - XML will be generated anyway, irrespective of the `TestModule.testReportXml` option, because structured output is needed in order to be able to parse it. So as a result it will be XML file + test result message, which can be seen in the tests. Adding HTML reporter is not yet possible without using 3rd party packages, because the one provided OOTB by Mocha is [not intended for CLI usage](https://mochajs.org/#html-reporter). I also had to modify the `Jvm.runSubprocess` method, so it doesn't throw if exit code is not 0, but returns result. To comply with the old behavior, all the old call sites will just call `getOrThrow` on the result. This change is needed, because if there is a test failure, `node` process will exit with code 1, but we still need to process and catching generic `Exception` is not an option (because maybe it is not because of the exit code). Upd: Binary compatibility check now complains that `Jvm.runSubprocess` has a different return type, but I'm not sure if it should be a problem, because before it was simply returning `Unit`. But if it is a problem, I can introduce a new method instead. --------- Co-authored-by: 0xnm <[email protected]> Co-authored-by: Li Haoyi <[email protected]>
- Loading branch information