Fetching a file from the resources directory (with e.g. window.fetch) works fine during development but it fails while running Karma tests. I’ve created an issue for this: KT-42923 (please upvote it if you struggle with this problem). I can’t figure out a workaround, I’ve tried messing around with a custom Karma config with proxies, modified basePath, etc. to no avail.
The core of the issue seems to be that during development, files from the resources directory are served by webpack-dev-server, while during Karma testing webpack-dev-server is not used and Karma/Webpack are not configured to serve the files in another way. Has anyone found a workaround for this problem?
Another issue I recently created (KT-42922) might be related to this.