Analysis error: Unexpected token on import in Istanbul

I use Istanbul to cover code with test claims.

During the Instrumenting process of the source code, I get the error message “Failed to parse, Unexpected Token”, and after passing the error, it is detected that the “import” marker creates a problem.

Worked on Angular2 and Typescript.

I use the command: istanbul instrument./dir/to/instrument/-o./out/dir/

In Istanbul, the default is to use the esprima parser to parse the code before using the toolkit. This is a parsing error, but I cannot find a solution to solve it.

Istanbul: v0.4.5

Esprima parser: v3.1.3

+4
source share

Source: https://habr.com/ru/post/1666453/


All Articles