-
Notifications
You must be signed in to change notification settings - Fork 45
Closed
Labels
ctg-bugIssue is a bugIssue is a buglang-javascriptIssue is related to JavaScript supportIssue is related to JavaScript support
Description
Description
Generated tests for samples\commonRecursion.js
doesn't cover line 4 (n < 0 branch).
To Reproduce
- Install the latest IU plugin built from unit-test-bot/rc3102023 branch in IntelliJ Idea Ultimate 2022.3.2
takeutbot-intellij-IU-2023.3.*
artefact - Create/open a JavaScript project
- Copy samples folder from
utbot-js
module and paste it into this project - Generate tests for Recursion.factorial(n) function in
samples/commonRecursion.js
- Check the generated tests
Expected behavior
There should be a test for every execution branch.
Or at least UnitTestBot should try to cover all lines during timeout.
Actual behavior
4-th line with condition (n < 0) is not covered with tests.
There are only 2 tests generated stably: for (n==0) and (n > 0).
Test generation finishes before timeout is reached.
Visual proofs (screenshots, logs, images)
const fileUnderTest = require("./../samples/commonRecursion.js")
const assert = require("assert")
///region Test suites for executable Recursion.factorial
it("testFactorial1", function ()
{
let recursion = new fileUnderTest.Recursion()
let actual = recursion.factorial(0.0)
assert.deepEqual(1, actual)
}
)
it("testFactorial2", function ()
{
let recursion = new fileUnderTest.Recursion()
let actual = recursion.factorial(1.1125370618783376E-308)
assert.deepEqual(-1.1125370618783376E-308, actual)
}
)
///endregion
Environment
Windows 10 Po
IntelliJ IDEA Ultimate 2022.3.2
Node.js 18.14.2
Additional context
Tried with the same result:
- Base / Fast mode
- Timeout 10/60 sec
Metadata
Metadata
Assignees
Labels
ctg-bugIssue is a bugIssue is a buglang-javascriptIssue is related to JavaScript supportIssue is related to JavaScript support
Type
Projects
Status
Done