Skip to content

coffee-coverage and CoffeeScript 1.11.x (ES2015 modules) #82

@wcjohnson

Description

@wcjohnson

With the release of 1.11, CoffeeScript has begun moving toward the ES2015+ standard. In particular, CoffeeScript now supports ES2015 import/export directives.

These do not play well with coffee-coverage right now, producing errors like this:

> mocha --recursive --compilers coffee:coffee-script/register --require coffee-coverage/register-istanbul


/Users/wcj/dev/ormojo/node_modules/ormojo/node_modules/coffee-coverage/lib/coffeeCoverage.js:321
      throw new CoverageError("Could not compile " + fileName + " after instrumenting: " + err.stack);
      ^
CoverageError: Could not compile /Users/wcj/dev/ormojo/node_modules/ormojo/src/Backend.coffee after instrumenting: SyntaxError: export statements must be at top-level scope

Presumably, export and import statements should simply be ignored when instrumenting, as they are meant to be declarative.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions