Skip to content

JS. Invalid test generation for multi-dimensional arrays #2143

Open
@zishkaz

Description

@zishkaz

Description

Parameters that have inferred type as multi-dimensional array crash test generation.

To Reproduce

  1. Install the Release 2022.12.1 plugin into Idea Ultimate 2022.2.4
  2. Create a JavaScript file with following contents:
function test(a) {
    if (a[0][0] === 0) {
        return 1
    }
    return 5
}

test([[1]])
  1. Generate tests for this function

Expected behavior

Correct tests are generated

Actual behavior

UnitTestBot throws an error: java.lang.UnsupportedOperationException: No test cases were generated for test

Visual proofs (screenshots, logs, images)

java.lang.UnsupportedOperationException: No test cases were generated for test
	at api.JsTestGenerator.makeTestsForMethod(JsTestGenerator.kt:204)
	at api.JsTestGenerator.run(JsTestGenerator.kt:142)
	at org.utbot.intellij.plugin.language.js.JsDialogProcessor$createTests$1.run(JsDialogProcessor.kt:195)

Environment

IntelliJ IDEA 2023.1 (Ultimate Edition)

Metadata

Metadata

Assignees

No one assigned

    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