Skip to content

JS. Invalid file instantiation for static methods #2050

Open
@alisevych

Description

@alisevych

Description

JavaScript. Tests generated for static methods. No file instantiation is needed

To Reproduce

  1. Install the Release 2022.12.1 plugin into Idea Ultimate 2022.2.4
  2. Create a JavaScript project with sample code
  3. Copy scenarioStaticMethod.js from utbot-js module and paste it into this project
  4. Generate tests for this file
  5. Run the tests

Expected behavior

Generated tests should be executed.

Actual behavior

Tests are broken.

Visual proofs (screenshots, logs, images)

The following tests are generated:

it("testFunctionToTest1", function ()
 {
    let object = new fileUnderTest.Object(true)
    
    let actual = object.functionToTest(1.0)
    
    assert.deepEqual(1, actual)
}
)

Environment

IntelliJ IDEA 2022.2.4 Ultimate
The same test are generated on IDEA 2022.3.3 - with the newest plugin built from unit-test-bot/rc2023.3 branch

Metadata

Metadata

Assignees

Labels

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

Type

No type

Projects

Status

Todo

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions