endjin / CucumberJS.TestAdapter

A basic Visual Studio Test Adapter for CucumberJS
MIT License
1 stars 1 forks source link

Error reading JArray from JsonReader. Path '', line 0, position 0. #5

Open icnocop opened 7 years ago

icnocop commented 7 years ago

Hi.

Thank you for CucumberJS.TestAdapter.

If an error occurs when node is run with cucumber.js for the test named "my test" for example, the Test Explorer's result pane displays the following error:

Test Failed - my test
Message: Error reading JArray from JsonReader. Path '', line 0, position 0.   at Newtonsoft.Json.Linq.JArray.Load(JsonReader reader, JsonLoadSettings settings)
   at Newtonsoft.Json.Linq.JArray.Parse(String json, JsonLoadSettings settings)
   at Newtonsoft.Json.Linq.JArray.Parse(String json)
   at Endjin.CucumberJs.TestAdapter.CucumberJsTestExecutor.RunTests(IEnumerable`1 tests, IRunContext runContext, IFrameworkHandle frameworkHandle)

The issue seems to be in CucumberJsTestExecutor.cs, lines 69-73.

For example, if the exit code of the process is not zero, does this indicate a failure when running node, even before any tests are run, as was my case? Also, if error is not null or empty, does this also indicate a failure? Also, if output is null or empty, does this also indicate a failure? If an error was detected, then the contents of both error and output should be displayed in the test result/output with a more meaningful error message.

Thank you.