5

Trying to add tests support into my project. Attached JsTestDriver with coverage plugin. Dummy tests are working correctly, but when I load up all my source files I'm getting application crashed with the following:

[java] **line 109:12 no viable alternative at input 'formFound'**
[java] Exception in thread "main" com.google.jstestdriver.coverage.CodeInstrumentor$InstrumentationException: error instrumenting /path/discover.js
[java]  at com.google.jstestdriver.coverage.CodeInstrumentor.instrument(CodeInstrumentor.java:74)
[java]  at com.google.jstestdriver.coverage.CoverageInstrumentingProcessor.process(CoverageInstrumentingProcessor.java:62)

This line of code looks like:

let formFound = tryToFindLoginForm();

I changed that definition into

var formFound = tryToFindLoginForm();

After that JSTD will pass over that string but will die on next let statement. Is there any way to workaround this, to tell JSTD the version of javascript used in code or something?

It'll be a very big issue to rewrite entire code into version without lets.

Thanks for help in advance.

Sharon
  • 138
  • 16
Chorn
  • 49
  • 3
  • This question helped me when I was trying to find the issue with on of my files not getting code coverage (it had `let`s and `const` initially which I had to change to `var`). Did you ever find a work around? – Sharon Aug 09 '19 at 10:08

0 Answers0