benbria / coffee-coverage

Istanbul and JSCoverage-style instrumentation for CoffeeScript files.
MIT License
145 stars 31 forks source link

Support CoffeeScript 2 features #88

Open GeoffreyBooth opened 7 years ago

GeoffreyBooth commented 7 years ago

Adding require 'coffee-coverage/register-istanbul' inside Cakefile’s runTests throws errors for the files with new features added in CoffeeScript 2 (note filenames):

CoverageError: Could not parse documentation/examples/jsx.coffee:
[stdin]:9:4: error: missing / (unclosed regex)
  </aside>
   ^

CoverageError: Could not parse documentation/examples/object_spread.coffee:
SyntaxError: unexpected ...

CoverageError: Could not parse documentation/examples/type_annotations.coffee:
SyntaxError: unexpected : string

And import or export statements, added in 1.11, still aren’t supported (#82):

CoverageError: Could not compile documentation/examples/modules.coffee after instrumenting:
SyntaxError: import statements must be at top-level scope
etamponi commented 7 years ago

I am pretty sure https://github.com/benbria/coffee-coverage/pull/91 isn't ready for a code base so large, but it might be worth a try? import/export aren't supported yet, but it might be a good starting point.

jwalton commented 6 years ago

https://github.com/benbria/coffee-coverage/pull/91 has been merged and published as v3.0.0.