# Kotlin js plugin test conceals Karma errors

**URL:** <https://discuss.kotlinlang.org/t/kotlin-js-plugin-test-conceals-karma-errors/14926>\
**Category:** JavaScript\
**Created:** [November 7, 2019, 10:37am UTC](https://discuss.kotlinlang.org/t/kotlin-js-plugin-test-conceals-karma-errors/14926 "2019-11-07T10:37:32Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![AltmanEA](https://avatars.discourse-cdn.com/v4/letter/a/aca169/32.png) [@AltmanEA](https://discuss.kotlinlang.org/u/AltmanEA)\
**Post date:** [November 7, 2019, 10:37am UTC](https://discuss.kotlinlang.org/t/kotlin-js-plugin-test-conceals-karma-errors/14926/1 "2019-11-07T10:37:32Z")

</div>

I try to test kotlin js module with new kotlin js plugin ([example project](https://github.com/AltmanEA/MCVE/tree/master/kotlinJsPlugin)). After addition to module items from kotlin.browser result of the “test” task is “BUILD SUCCESSFUL” despite a wrong assert in the test.  
When this task runs with --debug option a message “… node.exe’’ finished with exit value 1 (state: FAILED)” appear in log. How do I configure the plugin or the task to see this error by default? Is possible to test the js module with the kotlin.browser contents?

---

<div class="post-metadata">

**Author:** ![ivan.kubyshkin](https://sea1.discourse-cdn.com/flex019/user_avatar/discuss.kotlinlang.org/ivan.kubyshkin/32/7066_2.png) [@ivan.kubyshkin](https://discuss.kotlinlang.org/u/ivan.kubyshkin)\
**Post date:** [December 20, 2019, 12:52pm UTC](https://discuss.kotlinlang.org/t/kotlin-js-plugin-test-conceals-karma-errors/14926/2 "2019-12-20T12:52:51Z")

</div>

Hi! I reproduced the problem with your project. Note, that on the current version of Kotlin (1.3.61) the test failed with ClassCastException. This is a known [problem](https://youtrack.jetbrains.com/issue/KT-31888), because unit tests run `main` function and Kotlin cannot cast `document.getElementById("root") as HTMLDivElement`.
