busterjs/buster

Testing code that uses es6 module imports

gxxcastillo opened this issue · 5 comments

Is it possible to test code that is written using es6 module import statements?

For now, I'm generating a compiled version of my code under test, putting it all into one file, and testing that, however, it would be great if I could test the original code directly.

Is there anything that supports ES6 modules natively?

Good question. I'm just used to using Buster for all my testing and ran across that obstacle while trying to test a library I was working on. Admittedly, I still haven't fully wrapped my head around the issue of testing es6 modules.

I find that I end up doing what you said - generating a bundle, sometimes even one for tests, and testing that regardless if I'm using ES6 or not, browserify or webpack, etc.

Perhaps it would be worthwhile to look into StealJS. It imports and transpiles ES6 modules natively. There's a steal-qunit package that supports testing with qunit, perhaps there could be one built for busterjs.

Can this be closed?