When I try to run the tests in IDEA, using Jest, I get "Empty tests suite", and it says that the tests passed: 0 of 2 tests, and it's also not producing any snapshots. Is there any other way to run them?
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.
Hi, how do you unit test this Babel macro?
With AVA and snapshots. See here
When I try to run the tests in IDEA, using Jest, I get "Empty tests suite", and it says that the tests passed: 0 of 2 tests, and it's also not producing any snapshots. Is there any other way to run them?
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.Do you know maybe how can I import several custom babel-macros from one place in my project (For example index.js)?
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.
Thank you for your answers!
Is that possible to at least to import the macro from an absolute path instead of the relative one?
Yes, should be possible. I don't see why not