Skip to content

Commit 016fe00

Browse files
committed
test(js): make first js test works
1 parent ce4baad commit 016fe00

File tree

2 files changed

+23
-24
lines changed

2 files changed

+23
-24
lines changed

webstorm/src/test/kotlin/cc/unitmesh/ide/webstorm/provider/testing/JavaScriptWriteTestServiceTest.kt

Lines changed: 0 additions & 24 deletions
This file was deleted.
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
package cc.unitmesh.ide.webstorm.provider.testing;
2+
3+
import com.intellij.lang.javascript.JavascriptLanguage
4+
import com.intellij.lang.javascript.psi.ecmal4.JSClass
5+
import com.intellij.psi.PsiFileFactory
6+
import com.intellij.testFramework.LightPlatformTestCase
7+
8+
class JsWriteTestServiceTest: LightPlatformTestCase() {
9+
fun testShouldIdentifyIsExportedClass() {
10+
val code = """
11+
export class Foo {
12+
constructor() {
13+
}
14+
}
15+
""".trimIndent()
16+
17+
val file = PsiFileFactory.getInstance(project).createFileFromText(JavascriptLanguage.INSTANCE, code)
18+
val jsClazz = file.children.first() as JSClass
19+
val result = JavaScriptWriteTestService.isExportedClass(jsClazz)
20+
21+
assertTrue(result)
22+
}
23+
}

0 commit comments

Comments
 (0)