DEV Community

Discussion on: How to write simple babel macro

 
stereobooster profile image
stereobooster

Oh wait a second you right it is Jest. Why I thought it was AVA? Anyway, you should be able to run npm test in console.

Thread Thread
 
moranf profile image
Moran Fine

Do you know maybe how can I import several custom babel-macros from one place in my project (For example index.js)?

Thread Thread
 
stereobooster profile image
stereobooster

As far as I know this is not possible, this kind of contradicts the idea of macro. You need explicitly declare in each file which macro you want to use. If you want something to be applied everywhere you need to use babel-plugin for this.

I can be wrong here. You can open issue in babel-macro repository with this question.

Thread Thread
 
moranf profile image
Moran Fine

Thank you for your answers!
Is that possible to at least to import the macro from an absolute path instead of the relative one?

Thread Thread
 
stereobooster profile image
stereobooster

Yes, should be possible. I don't see why not