Skip to content

Commit 1fc2839

Browse files
committed
Support -PmochaTest=pattern option to filter JS tests
1 parent 9f33574 commit 1fc2839

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

gradle/test-mocha-js.gradle

+2
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ task testMochaNode(type: NodeTask, dependsOn: [compileTestKotlin2Js, installDepe
1313
script = file("$node.nodeModulesDir/node_modules/mocha/bin/mocha")
1414
args = [compileTestKotlin2Js.outputFile, '--require', 'source-map-support/register']
1515
if (project.hasProperty("teamcity")) args += ['--reporter', 'mocha-teamcity-reporter']
16+
if (project.hasProperty("mochaTests")) args += ['--grep', "$mochaTests"]
1617
}
1718

1819
test.dependsOn testMochaNode
@@ -62,6 +63,7 @@ task testMochaChrome(type: NodeTask, dependsOn: prepareMochaChrome) {
6263
script = file("$node.nodeModulesDir/node_modules/mocha-headless-chrome/bin/start")
6364
args = [compileTestKotlin2Js.outputFile, '--file', mochaChromeTestPage]
6465
if (project.hasProperty("teamcity")) args += ['--reporter', 'mocha-teamcity-reporter']
66+
if (project.hasProperty("mochaTests")) args += ['--grep', "$mochaTests"]
6567
}
6668

6769
// todo: Commented out because mocha-headless-chrome does not work on TeamCity

0 commit comments

Comments
 (0)