Oliver.O
09/26/2025, 12:33 PMVampire
09/26/2025, 12:49 PMOliver.O
09/26/2025, 12:51 PM--tests filters.Vampire
09/26/2025, 12:55 PMkotest for example cannot work with --tests on JS.
It can work with --tests but only on class level for JVM, but not on test level.
On JVM you can set a special system property to filter on class level and also on test level.
On JVM and Native you can set a special environment variable to filter on class level and also on test level.
On JS afair it does not have a way currently.Vampire
09/26/2025, 12:55 PMOliver.O
09/26/2025, 12:59 PMEdoardo Luppi
09/26/2025, 1:11 PMThe Kotlin/JS test infra has a way to transport theYes because as far as I recall that's passed in as a Mocha CLI argument.filters.--tests
Oliver.O
09/26/2025, 1:13 PMEdoardo Luppi
09/26/2025, 1:17 PMKotlinJsTest.nodeJsArgs input, but I've never used it.Edoardo Luppi
09/26/2025, 1:18 PMOliver.O
09/26/2025, 1:19 PMEdoardo Luppi
09/26/2025, 1:19 PMOliver.O
09/26/2025, 1:21 PMHow can I pass a parameter from the Gradle command line to my JS tests (Node, browser, Wasm)? Example: Indicate if tests run on CI.
Oliver.O
09/28/2025, 8:37 PMAdam Semenenko
09/29/2025, 9:01 AMCI environment variable is set in GitHub Actions?Ilya Goncharov [JB]
09/29/2025, 9:14 AMHow can I pass a parameter from the Gradle command line to my JS tests (Node, browser, Wasm)? Example: Indicate if tests run on CI.In
KotlinJsTest you can provide environment variable to test process.
But it will work only with Node.js tests (because tests are run exactly in the same node.js process).
For browser I am not sure that it works like that, because tests are run in a browser, but environment variables are set for node.js process.
For karma it is a bit tricky
You can use something following in karma.config.d/env.js :
config.client = config.client || {};
config.client.env = {
IS_CI: true
}
In your runtime you don’t have environment variables in browser, so they are emulated in an object
window.__karma__.config.clientOliver.O
09/29/2025, 9:25 AMAre you able to check to see if theI'm actually using my own, but yes, I can see it. Using environment variables in Node.js is fine (I'm already doing that for the JVM and Native). I'll explore the Karma tip for the JS+Wasm/JS browser-based tests, that sounds very useful! I'll report back my results.environment variable is set in GitHub Actions?CI
Oliver.O
09/29/2025, 3:54 PMwindow.__karma__.config.client. But window.__karma__.config.env['IS_CI'] works. kodee happy
(Note that env appears only if at least one environment variable is present.)