Skip to content

Commit 4776d49

Browse files
authored
feat: support test.* function (#33)
1 parent d91d8e9 commit 4776d49

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

src/main/kotlin/no/eirikb/avatest/actions/AvaJavaScriptTestRunnerRunConfigurationGenerator.kt

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,15 @@ import com.intellij.psi.PsiElement
2222
import com.jetbrains.nodejs.run.NodeJsRunConfiguration
2323
import java.nio.file.Paths
2424

25-
fun JSCallExpression.isTest() = this.methodExpression?.text.equals("test")
25+
fun JSCallExpression.isTest(): Boolean {
26+
var text = this.methodExpression?.text
27+
28+
if (text != null) {
29+
return text == "test" || text.startsWith("test.")
30+
}
31+
32+
return false;
33+
}
2634

2735
class AvaJavaScriptTestRunnerRunConfigurationGenerator : AnAction() {
2836
companion object {

0 commit comments

Comments
 (0)