Is there an up to date sample project I can take a...
# javascript
g
Is there an up to date sample project I can take a look at that has tests setup to run in the browser? I'm having trouble getting my tests to run by following the official docs.
t
We have tests here
But we use common configuration
g
I am trying to run the browserTest gradle task to test what is rendering on the screen. An alternative would be to use something like enzyme but not sure if there is a wrapper for that
Here's my
build.gradle.kts
file for the javascript portion of my multi project build. I have a common project and jvm project also.
Copy code
plugins {
    kotlin("js")
}

group = "com.learner.frontend"
version = "1.0-SNAPSHOT"

repositories {
    mavenCentral()
}

val kotlinWrappersVersion = "1.0.0-pre.340"

dependencies {
    implementation(project(":shared"))
    implementation(enforcedPlatform("org.jetbrains.kotlin-wrappers:kotlin-wrappers-bom:$kotlinWrappersVersion"))
    implementation("org.jetbrains.kotlin-wrappers:kotlin-react")
    implementation("org.jetbrains.kotlin-wrappers:kotlin-react-dom")
    implementation("org.jetbrains.kotlin-wrappers:kotlin-styled-next")
    implementation("org.jetbrains.kotlin-wrappers:kotlin-react-router-dom")
    implementation("org.jetbrains.kotlin-wrappers:kotlin-redux")
    implementation("org.jetbrains.kotlin-wrappers:kotlin-react-redux")

    testImplementation(kotlin("test-js"))
}

kotlin {
    js(IR) {
        binaries.executable()
        browser {
            commonWebpackConfig {
                cssSupport.enabled = true
            }
            testTask {
                useKarma {
                    useChrome()
                }
            }
        }
    }
}
t
We use puppeteer with Chrome Headless on CI server here
to test what is rendering on the screen
Looks like puppeteer use case, he will install required Chrome version yourself