Hi, how can I run Unit tests inside with a library...
# javascript
a
Hi, how can I run Unit tests inside with a library that needs to be run into the browser ? I tried adding this
Copy code
testImplementation(kotlin("test-js"))
testImplementation(kotlin("test-junit"))
testImplementation(kotlin("test-js-runner"))
And just using
@Test
on a method and
assertNotNull
, but when running I'm getting this error
Copy code
Execution failed for task ':browserTest'.
> Cannot find node module "kotlin-test-js-runner/kotlin-test-karma-runner.js" in "C:\...\IdeaProjects\libs\PIXI-Kotlin\build\js\packages\PIXI-Kotlin-test"
t
If you are testing the usage of a library, that's technically an integration test. It may be possible with a unit test library, but it may not.
This may help set up karma to run the tests in a headless chrome
But I would think whether you want integration tests or unit tests. If you want unit tests, I would substitute the real library for a test double
a
Thanks for the help, I'll try tomorrow !