Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

NPE on global arrow function declaration #1503

Open
Assignees
Labels
ctg-bugIssue is a bug lang-javascriptIssue is related to JavaScript support
@tyuldashev

Description

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 bug lang-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

      AltStyle によって変換されたページ (->オリジナル) /