busterjs / buster

Abandoned - A powerful suite of automated test tools for JavaScript.
http://docs.busterjs.org
Other
448 stars 37 forks source link

Testing code that uses es6 module imports #475

Open gxxcastillo opened 8 years ago

gxxcastillo commented 8 years ago

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.

dominykas commented 8 years ago

Is there anything that supports ES6 modules natively?

gxxcastillo commented 8 years ago

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.

dominykas commented 8 years ago

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.

green3g commented 8 years ago

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.

mroderick commented 8 years ago

Can this be closed?