From 8b05cca7d29678d7aabc45764648b10db7890fd5 Mon Sep 17 00:00:00 2001 From: "J. Ryan Stinnett" Date: Fri, 18 Jan 2019 10:55:00 -0600 Subject: [PATCH] Add file-loader to Karma so assets will resolve in tests --- karma.conf.js | 4 ++++ package.json | 1 + 2 files changed, 5 insertions(+) diff --git a/karma.conf.js b/karma.conf.js index 4d699599cb..93063dbc04 100644 --- a/karma.conf.js +++ b/karma.conf.js @@ -168,6 +168,10 @@ module.exports = function (config) { path.resolve('./test'), ] }, + { + test: /\.(gif|png|svg|ttf)$/, + loader: 'file-loader', + }, ], noParse: [ // for cross platform compatibility use [\\\/] as the path separator diff --git a/package.json b/package.json index 15d1eff836..dc46d437ec 100644 --- a/package.json +++ b/package.json @@ -125,6 +125,7 @@ "eslint-plugin-react": "^7.7.0", "estree-walker": "^0.5.0", "expect": "^23.6.0", + "file-loader": "^3.0.1", "flow-parser": "^0.57.3", "jest-mock": "^23.2.0", "karma": "^3.0.0",