Skip to content

Commit 679acb0

Browse files
rudolf101zishkaz
andauthored
General JavaScript module update (#1787)
Co-authored-by: Sergey Loktev <71882967+zishkaz@users.noreply.github.com>
1 parent e7216c1 commit 679acb0

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

44 files changed

+998
-980
lines changed

utbot-intellij-js/src/main/kotlin/org/utbot/intellij/plugin/language/js/JsDialogProcessor.kt

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -61,15 +61,15 @@ object JsDialogProcessor {
6161
checkAndInstallRequirement(model.project, model.pathToNPM, mochaData)
6262
checkAndInstallRequirement(model.project, model.pathToNPM, nycData)
6363
checkAndInstallRequirement(model.project, model.pathToNPM, ternData)
64-
createDialog(model)?.let { dialogProcessor ->
65-
if (!dialogProcessor.showAndGet()) return@invokeLater
64+
createDialog(model)?.let { dialogWindow ->
65+
if (!dialogWindow.showAndGet()) return@invokeLater
6666
// Since Tern.js accesses containing file, sync with file system required before test generation.
6767
runWriteAction {
6868
with(FileDocumentManager.getInstance()) {
6969
saveDocument(editor.document)
7070
}
7171
}
72-
createTests(dialogProcessor.model, containingFilePath, editor)
72+
createTests(dialogWindow.model, containingFilePath, editor)
7373
}
7474
}
7575
}
@@ -138,6 +138,7 @@ object JsDialogProcessor {
138138
this.pathToNode = pathToNode
139139
this.pathToNPM = pathToNPM
140140
}
141+
141142
}
142143

143144
private fun createDialog(jsTestsModel: JsTestsModel?) = jsTestsModel?.let { JsDialogWindow(it) }
@@ -182,7 +183,8 @@ object JsDialogProcessor {
182183
pathToNPM = model.pathToNPM,
183184
timeout = model.timeout,
184185
coverageMode = model.coverageMode
185-
)
186+
),
187+
isCancelled = { indicator.isCanceled }
186188
)
187189

188190
indicator.fraction = indicator.fraction.coerceAtLeast(0.9)

utbot-js/build.gradle.kts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ dependencies {
2929
testImplementation("org.junit.jupiter:junit-jupiter-api:5.8.1")
3030
testRuntimeOnly("org.junit.jupiter:junit-jupiter-engine:5.8.1")
3131
api(project(":utbot-framework"))
32-
implementation(project(":utbot-fuzzers"))
32+
api(project(":utbot-fuzzers"))
3333
// https://mvnrepository.com/artifact/com.google.javascript/closure-compiler
3434
implementation("com.google.javascript:closure-compiler:v20221102")
3535

@@ -39,6 +39,7 @@ dependencies {
3939
// https://mvnrepository.com/artifact/commons-io/commons-io
4040
implementation(group = "commons-io", name = "commons-io", version = "2.11.0")
4141

42+
implementation(group = "io.github.microutils", name = "kotlin-logging", version = kotlinLoggingVersion)
4243
implementation("org.functionaljava:functionaljava:5.0")
4344
implementation("org.functionaljava:functionaljava-quickcheck:5.0")
4445
implementation("org.functionaljava:functionaljava-java-core:5.0")

utbot-js/samples/bitOperators.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,4 +28,4 @@ class BitOperators {
2828
}
2929
return (0x77777777 << shift) === 0x77777770 ? 2 : 3
3030
}
31-
}
31+
}

utbot-js/samples/commonIfStatement.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,4 +4,4 @@ function foo(a,b) {
44
} else {
55
return -1
66
}
7-
}
7+
}

utbot-js/samples/commonLoops.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,4 +24,4 @@ class Loops {
2424
}
2525
return -1
2626
}
27-
}
27+
}

utbot-js/samples/commonRecursion.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,4 +16,4 @@ class Recursion {
1616
return 1
1717
return this.fib(n - 1) + this.fib(n - 2)
1818
}
19-
}
19+
}

utbot-js/samples/commonString.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,4 +16,4 @@ class StringExamples {
1616
length(cs) {
1717
return cs == null ? 0 : cs.length
1818
}
19-
}
19+
}

utbot-js/samples/functionsThrowExceptionsInRow.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,4 +15,4 @@ function goodBoy(a) {
1515
default:
1616
return 0
1717
}
18-
}
18+
}

utbot-js/samples/scenarioMultyClassNoTopLevel.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,4 +36,4 @@ class Kek {
3636
done() {
3737
return this.toString()
3838
}
39-
}
39+
}

utbot-js/samples/scenarioObjectParameter.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,4 +13,4 @@ function functionToTest(obj, v) {
1313
return obj.performAction(v)
1414
}
1515

16-
functionToTest(new ObjectParameter(5), 5)
16+
functionToTest(new ObjectParameter(5), 5)

utbot-js/samples/scenarioStaticMethod.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,4 +10,4 @@ class Object {
1010
}
1111
return value
1212
}
13-
}
13+
}

utbot-js/samples/scenarioThrowError.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,4 +8,4 @@ function functionToTest(a) {
88
return -1
99
}
1010

11-
}
11+
}

0 commit comments

Comments
 (0)