0

I am unit testing angular application.

I couldn't able to execute unit tests of code which are written using ES6 on Chutzpah.

What could be the possible solution?

I need a stable way to achieve this.

Krishna
  • 154
  • 4
  • 14

1 Answers1

0

I am answering my own question as Vaviloff didn't posted any answer but He told me in the comment section.

So,

Babel is the answer to this question.

Here is the link to babel

Babel is a Javascript compiler which transpiles the ES6 code to ES5.

Babel will change your ES6 syntax to ES5 and then you can unit test the output using Phantom js or Chutspah.

Krishna
  • 154
  • 4
  • 14
  • 1
    This is indeed what I wrote, but for a comment to become an answer it should contain more matter: for example, a configuration sample for Chutspah with babel enabled. Otherwise a reader in future will have to keep on looking for real solution. – Vaviloff Feb 21 '18 at 12:10