Skip to content

Commit

Permalink
Mock out static files when running in Jest (elastic#13315)
Browse files Browse the repository at this point in the history
  • Loading branch information
sorenlouv authored and cjcenizal committed Aug 11, 2017
1 parent 82d79bd commit 997abb7
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/jest/config.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,8 @@
],
"moduleNameMapper": {
"^ui_framework/components": "<rootDir>/ui_framework/components",
"\\.(jpg|jpeg|png|gif|eot|otf|webp|svg|ttf|woff|woff2|mp4|webm|wav|mp3|m4a|aac|oga)$": "<rootDir>/ui_framework/src/test/file_mock.js"
"\\.(jpg|jpeg|png|gif|eot|otf|webp|svg|ttf|woff|woff2|mp4|webm|wav|mp3|m4a|aac|oga)$": "<rootDir>/src/jest/file_mock.js",
"\\.(css|less|scss)$": "<rootDir>/src/jest/style_mock.js"
},
"coverageDirectory": "<rootDir>/target/jest-coverage",
"coverageReporters": [
Expand Down
1 change: 1 addition & 0 deletions src/jest/file_mock.js
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
module.exports = 'test-file-stub';
1 change: 1 addition & 0 deletions src/jest/style_mock.js
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
module.exports = {};
Empty file removed ui_framework/src/test/file_mock.js
Empty file.

0 comments on commit 997abb7

Please sign in to comment.