-
Notifications
You must be signed in to change notification settings - Fork 1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
unit tests and third party dependencies #736
Comments
We don't currently support transpilation of es6 modules out-of-the-box. We investigated it a long time ago, but Babel was far too slow. The reason this happens is because Karma produces a webpack bundle containing the test code and its dependencies, and webpack passes through the es6 code. There are a couple of options for you/us/everyone:
|
Thanks for the exhaustive answer Ian, |
It would probably be simplest as a new post-TS task. It's pretty simple to put together an ad-hoc task in your gulpfile. |
Issues that have been closed & had no follow-up activity for at least 7 days are automatically locked. Please refer to our wiki for more details, including how to remediate this action if you feel this was done prematurely or in error: Issue List: Our approach to locked issues |
Category
Expected or Desired Behavior
Importing a dependency for unit testing that relies on es6/2015 should work. (transpilation should be implemented for things in node_modules)
Observed Behavior
PhantomJs systematically fails when writing any unit tests that rely on a library using es6/2015 with error messages similar to this one.
PhantomJS 2.1.1 (Windows 8 0.0.0) ERROR SyntaxError: Use of reserved word 'let' in strict mode
(eventually the error with PhantomJS will be solved when they ship 2.5 with es2015/6 support, however we'll still run into that with IE and Safari unit tests)
Steps to Reproduce
Implement a unit test like this one for a webpart and install chai-as-promised 7+ as well as @types/chai-as-promised
Related issues
ariya/phantomjs#14506
chaijs/chai-as-promised#207
chaijs/chai-as-promised#211
The text was updated successfully, but these errors were encountered: