miragejs / ember-cli-mirage

An Ember Addon to easily add Mirage JS to your Ember app.
http://ember-cli-mirage.com
MIT License
863 stars 439 forks source link

Mirage cannot preload assets #2488

Closed abeaudoin2013 closed 1 year ago

abeaudoin2013 commented 1 year ago

When I run tests that try to fetch assets, a Mirage error surfaces in my console:

Screen Shot 2023-02-08 at 10 13 31 AM

Essentially it's complaining that the route to this asset is not defined in the mirage config file's routes() function. This particular error comes from a request to a CDN, however I get this same complaint when trying to fetch assets that live within my project directory.

When I add these routes using this.passthrough('https://cdnjs.cloudflare.com/ajax/libs/**') for example, I get a timeout error that looks like this:

Screen Shot 2023-02-08 at 10 43 50 AM

It becomes further complicated when I isolate a particular module throwing this error because then I do not see the error at all. It only occurs when I run the whole test suite.

Any idea what I could be doing wrong?

cah-brian-gantzler commented 1 year ago

ember-cli-mirage is a thin wrapper to import mirageJS. Someone better may know if you place this on https://github.com/miragejs/miragejs. Since this also has to do with passthru, based on some of the other issues it might be better on https://github.com/pretenderjs/pretender since thats what mirage uses to do the actual interception

abeaudoin2013 commented 1 year ago

Thanks, Brian. I kind of figured I might have to post there, but thought I'd try here first. I'll take a look.