Skip to content

Conflicts with babel-plugin-istanbul #4

Open
@ELLIOTTCABLE

Description

@ELLIOTTCABLE
   "presets": [ "power-assert" ]
 , "plugins": [ "istanbul" ]

So, I can't narrow it down to a simple test-case; but at the moment, using the power-assert preset (for testing output) alongside the istanbul plugin (for coverage generation) produces obscure syntax errors inside babel:

/home/travis/build/ELLIOTTCABLE/giraphe/node_modules/babel-core/lib/transformation/file/index.js:590
      throw err;
      ^
SyntaxError: /home/travis/build/ELLIOTTCABLE/giraphe/giraphe.js: Invalid left-hand side in prefix operation (3097:69)
  3095 |        KEY = (++cov_1mlpy989m8.s[53], null != opts.keyer ? (++cov_1mlpy989m8.b[19][0], opts.keyer.call(current, current)) : (++cov_1mlpy989m8.b[19][1], current[opts.key]));
  3096 |    ++cov_1mlpy989m8.s[54];
> 3097 |    (0, _powerAssert2.default)(_rec5._expr(_rec5._capt((_rec5._capt(++_rec5._capt(_rec5._capt(_rec5._capt(_rec5._capt(cov_1mlpy989m8, 'arguments/0/left/expressions/0/argument/object/object/object').b, 'arguments/0/left/expressions/0/argument/object/object')[20], 'arguments/0/left/expressions/0/argument/object')[0], 'arguments/0/left/expressions/0/argument'), 'arguments/0/left/expressions/0'), _rec5._capt(_rec5._capt(typeof KEY === 'undefined' ? 'undefined' : (0, _typeof3.default)(KEY), 'arguments/0/left/expressions/1/left') === 'string', 'arguments/0/left/expressions/1')) && (_rec5._capt(++_rec5._capt(_rec5._capt(_rec5._capt(_rec5._capt(cov_1mlpy989m8, 'arguments/0/right/expressions/0/argument/object/object/object').b, 'arguments/0/right/expressions/0/argument/object/object')[20], 'arguments/0/right/expressions/0/argument/object')[1], 'arguments/0/right/expressions/0/argument'), 'arguments/0/right/expressions/0'), _rec5._capt(_rec5._capt(KEY, 'arguments/0/right/expressions/1/left') !== '', 'arguments/0/right/expressions/1')), 'arguments/0'), {
       |                                                                      ^
  3098 |       content: 'assert((++cov_1mlpy989m8.b[20][0], typeof KEY === \'string\') && (++cov_1mlpy989m8.b[20][1], KEY !== \'\'))',
  3099 |       filepath: './giraphe.es6.js',
  3100 |       line: 102
    at Parser.pp$5.raise (/home/travis/build/ELLIOTTCABLE/giraphe/node_modules/babylon/lib/index.js:4454:13)
    at Parser.pp$2.checkLVal (/home/travis/build/ELLIOTTCABLE/giraphe/node_modules/babylon/lib/index.js:3233:14)
    at Parser.checkLVal (/home/travis/build/ELLIOTTCABLE/giraphe/node_modules/babylon/lib/index.js:6086:22)
    at Parser.pp$3.parseMaybeUnary (/home/travis/build/ELLIOTTCABLE/giraphe/node_modules/babylon/lib/index.js:3464:12)

(More: https://travis-ci.org/ELLIOTTCABLE/giraphe/jobs/245592548#L224-L372)

This is fixed by removing babel-preset-power-assert and replacing it with the individual plugins themselves, and then loading all three of them as babel plugins, instead of presets.

   "plugins": [ "espower", "empower-assert", "istanbul" ]

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions