Istanbul: Transformation error; return original code. Unexpected token ...

Created on 5 Jan 2019  Â·  3Comments  Â·  Source: gotwarlost/istanbul

After trying to merge objects in my code using:

this.config = { ...defaultConfig, ...config };

I get the error:

Transformation error; return original code

Unexpected token ...

And test coverage is not reported for that file. If that line is commented then test coverage is reported and the error goes away.

Most helpful comment

This package is now deprecated and doesn't support ES6. Use nyc - instanbul.js.org. It works with the babel-plugin-instanbul and has full class support for ES6.

It is also very easy to setup

$ npm install --save-dev nyc

Then in your package.json

{
  "scripts": {
    "test": "nyc mocha"
  }
}

Happy coding :smile:

All 3 comments

Same here. My version is "istanbul": "^0.4.5", (latest non-alpha)

✗ node --version
v8.15.0

This package is now deprecated and doesn't support ES6. Use nyc - instanbul.js.org. It works with the babel-plugin-instanbul and has full class support for ES6.

It is also very easy to setup

$ npm install --save-dev nyc

Then in your package.json

{
  "scripts": {
    "test": "nyc mocha"
  }
}

Happy coding :smile:

It would be helpful if that deprecation warning was right at the top of the readme -- as in big bold letters -- along with this suggestion for an alternate.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

Raynos picture Raynos  Â·  27Comments

jasonpincin picture jasonpincin  Â·  22Comments

NiGhTTraX picture NiGhTTraX  Â·  36Comments

amoufaddel picture amoufaddel  Â·  28Comments

lizhexia picture lizhexia  Â·  60Comments