Skip to content

NPE on global arrow function declaration #1503

Open
@tyuldashev

Description

@tyuldashev

Description

In case function declared through arrow function expression UTBot fails to generate tests

To Reproduce

Steps to reproduce the behavior:

  1. Open https://www.utbot.org/demo for JavaScript
  2. Generate test for following code:
const square = (x) => x * x;

Expected behavior
Tests are generated

Actual behavior
No tests are generated, log contains following error:

Status Code: TEST_GENERATION_FAILED

TEST GENERATION: FAILED
WARNING: sun.reflect.Reflection.getCallerClass is not supported. This will impact performance.
12:33:39.824 | ERROR | JsGenerateTestsCommand | An error has occurred while generating tests for file /var/utbot/processing/utbot-javascript-084547/source.js : java.lang.NullPointerException
java.lang.NullPointerException
	at api.JsTestGenerator.run(JsTestGenerator.kt:108)
	at org.utbot.cli.JsGenerateTestsCommand.run(JsGenerateTestsCommand.kt:69)
	at com.github.ajalt.clikt.parsers.Parser.parse(Parser.kt:204)
	at com.github.ajalt.clikt.parsers.Parser.parse(Parser.kt:213)
	at com.github.ajalt.clikt.parsers.Parser.parse(Parser.kt:17)
	at com.github.ajalt.clikt.core.CliktCommand.parse(CliktCommand.kt:396)
	at com.github.ajalt.clikt.core.CliktCommand.parse$default(CliktCommand.kt:393)
	at com.github.ajalt.clikt.core.CliktCommand.main(CliktCommand.kt:411)
	at com.github.ajalt.clikt.core.CliktCommand.main(CliktCommand.kt:436)
	at org.utbot.cli.ApplicationKt.main(Application.kt:38)

TEST RUN: ERROR OCCURRED
[object Object]: no details

Metadata

Metadata

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