# In tests - Error: Failed loading required CSS file

**URL:** <https://discourse.aurelia.io/t/in-tests-error-failed-loading-required-css-file/5504>\
**Category:** Help Requests\
**Created:** [July 29, 2024, 8:26am UTC](https://discourse.aurelia.io/t/in-tests-error-failed-loading-required-css-file/5504 "2024-07-29T08:26:49Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![vladyn](https://yyz1.discourse-cdn.com/flex027/user_avatar/discourse.aurelia.io/vladyn/32/2473_2.png) [@vladyn](https://discourse.aurelia.io/u/vladyn)\
**Post date:** [July 29, 2024, 8:26am UTC](https://discourse.aurelia.io/t/in-tests-error-failed-loading-required-css-file/5504/1 "2024-07-29T08:26:49Z")

</div>

Hello there,  
I have a small, but painful issue with my tests - When I try to test the component, I get the following error:  
`Error: Failed loading required CSS file`.  
I’m using a plain CSS file and everything I’m my webpack is the default for a newly bootstraped AU 1 app.  
I found this topic [How to mock css that is loaded via html require when testing components - #2 by stevies](https://discourse.aurelia.io/t/how-to-mock-css-that-is-loaded-via-html-require-when-testing-components/1642/2)  
but I don’t see a working solution there.

 ![image](https://canada1.discourse-cdn.com/flex027/uploads/aurelia/original/2X/0/0cc5c36841707e7f1d5f47f5698f6adb515f2d7f.png)

---

<div class="post-metadata">

**Author:** ![bigopon](https://yyz1.discourse-cdn.com/flex027/user_avatar/discourse.aurelia.io/bigopon/32/18_2.png) [@bigopon](https://discourse.aurelia.io/u/bigopon)\
**Post date:** [July 30, 2024, 10:54pm UTC](https://discourse.aurelia.io/t/in-tests-error-failed-loading-required-css-file/5504/2 "2024-07-30T22:54:43Z")

</div>

usually you can inject the Loader, spy & stub the loading css part as well, if other techniques don’t work. jest itself also provide an good number of tools to mock modules.
