Skip to content

JS. Function call has extra apostrophes #1940

Closed
@alisevych

Description

@alisevych

Description

Function call na.'double'() from a generated test has extra apostrophes.

To Reproduce

  1. Install the latest IU plugin built from unit-test-bot/rc3102023 branch in IntelliJ Idea Ultimate 2022.2.4 - take utbot-intellij-IU-2023.3.* artefact
  2. Create a JavaScript project with sample code
  3. Copy samples folder from utbot-js module and paste it into this project
  4. Generate tests for Na.double() function in samples/scenarioMultyClassNoTopLevel.js

Expected behavior

Function calls in the generated tests are supposed to be correctly rendered and compillable.
Expected - compiling, test passes with this code:

na.double()

Actual behavior

Function call na.'double'() from a generated test has extra apostrophes.
Actual piece of code:

na.`double`()

Visual proofs (screenshots, logs, images)

The following test is generated:

const fileUnderTest = require("./../samples/scenarioMultyClassNoTopLevel.js")
const assert = require("assert")

///region Test suites for executable Na.double

///region

it("testDouble1", function ()
 {
    let na = new fileUnderTest.Na("\n\t\n")
    
    let actual = na.`double`()
    
    assert.deepEqual(0, actual)
}
)
///endregion

///endregion

Environment

Windows 10

Additional context

The function expects a number, but it is given a String.

Metadata

Metadata

Assignees

Labels

ctg-bugIssue is a buglang-javascriptIssue is related to JavaScript support

Type

No type

Projects

Status

Done

Relationships

None yet

Development

No branches or pull requests

Issue actions