mock-css-modules
mock-css-modules copied to clipboard
It doesn't work with transpiled imports
Hi, I am using Ava to run my tests.
I don't know what I am doing wrong but this should work:
import mockCSS from 'mock-css-modules';
mockCSS.register(['.scss', '.css']);
import '../some-style.scss';
throws an error
however if I rewrite it using commonjs require
import mockCSS from 'mock-css-modules';
mockCSS.register(['.scss', '.css']);
require('../some-style.scss');
it works.
Babel should transpire all imports into requires. I don't really know why this doesn't work.
I'm unfamiliar with Ava. What error do you get with the import? Could you create a minimal project that exhibits this behavior?