vazco / universe-modules

Use ES6 / ES2015 modules in Meteor with SystemJS
https://atmospherejs.com/universe/modules
MIT License
52 stars 7 forks source link

Is there way to use universe:modules with Velocity tests? #28

Closed art-in closed 9 years ago

art-in commented 9 years ago

In my app all files are universe:modules. Is there any way to reference them from Velocity tests with import?

I've tried to create test file with .import.js extension and import inside to reference my source module, but looks like this test file is not handled as module since I got "reserved word"-error on it.

Is my only option is System.import('myModule').then(function(module) {}) ?

MacRusher commented 9 years ago

Did you add api.use('universe:modules'); in your Package.onTest? Or other equivalent that velocity is using? I'm not familiar with velocity tests and haven't used them with modules yet, but "reserver word" error will happen if file is not parsed by modules, and this could happen in case of missing dependency.

Using System.import in plain js test file is a valid use case and it can be even easier to write async tests with this syntax. Of course to load a module it need to be parsed by build plugin first anyway.

art-in commented 9 years ago

@MacRusher I'm not familiar with api.use('universe:modules') and Package.onTest yet. Going to investigate this later and post back. Thanks.

art-in commented 9 years ago

Looks like this will be addressed by https://github.com/meteor-velocity/velocity/issues/356