I’d prefer not to load this css in my javascript, is it possible for the component tester to load css via the require tag? If not, is it possible to mock that dependency? I’ve tried adding withResources('src/some.css') but that didn’t work.
I found another solution by testing only JS, not using StageComponent. I want to test method calls, and I think I can’t do that using StageComponent, am I right?
StageComponent is to help you simulate your app/custom elements/custom attributes/etc… running in normal condition, by starting up a semi-app, with necessary setup to help you reduce boiler plate and test what is important to your code: lifecycle, change handler, binding, template behavior. If you just want to test some method, the answer could be either use StageComponent or just instantiate a class and call the method yourself. But it any case, having StageComponent should get you more ready for full blown integration testing, which is more beneficial in the end.
Has anybody found a solid solution for this besides use scss. I am running into this issue still as well. WE tried implementing both the Mocking CSS Modules and the Handling Static Assets sections on https://jestjs.io/docs/en/webpack.html#mocking-css-modules and neither seemed to have any effect. I read somewhere that Aurelia uses npm to do imports directly from the view.
We have to use stage component because we are using aurelia validation and we need to be able to include add the validation as a plugin.