Skip to content

JS. Incorrect Run configuration for the generated tests #1903

Closed
@alisevych

Description

@alisevych

Description

When trying to run the tests generated with default settings, there is an error in Run configuration.
utbot_tests\ folder is missing in the path.
Also Mocha should be used as the runner.

To Reproduce

  1. Run the 'utbot' project in IntelliJ Idea 2022.2.*, get the latest main
  2. Set ideType=IU
  3. Run Gradle task runIde
  4. Create JS project, copy-paste a sample file to the project folder, f.i. utbot-js/samples/commonIfStatement.js
  5. Generate tests for it with UnitTestBot
  6. Right-click on the code of the generated test-file and select to Run it

Expected behavior

Tests are supposed to be run successfully.
Run configuration should be with Mocha.
Correct path to the test file should be applied.

Actual behavior

Edit Configuration dialog is displayed with (!) Error: Please specify path to JavaScript file correctly
utbot_tests\ is missing in the JavaScript file: field.
Node.js is used to run the test.

Visual proofs (screenshots, logs, images)

image

Environment

Windows 10 Pro
IntelliJ IDEA Ultimate 2022.2.2
Node.js 18.14.2

Additional context

If right-click on the file in Project view and select to run - the tests are run correctly.
Mocha is used - while when trying to run from code - Node.js is used.

image

Metadata

Metadata

Labels

comp-ideIssue is related to IDE supportctg-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