From 1fd797f52a74d52a4e0801fb25b9cace1d0796a1 Mon Sep 17 00:00:00 2001 From: Jeff Avallone Date: Tue, 13 Feb 2018 17:15:33 -0500 Subject: [PATCH] Adding identity-obj-proxy for CSS module mocks --- package.json | 3 ++- src/__mocks__/styleMock.js | 1 - .../Header/__snapshots__/test.js.snap | 1 + .../Message/__snapshots__/test.js.snap | 20 +++++++++++++------ yarn.lock | 8 +++++++- 5 files changed, 24 insertions(+), 9 deletions(-) delete mode 100644 src/__mocks__/styleMock.js diff --git a/package.json b/package.json index 1d842f4..2c20591 100644 --- a/package.json +++ b/package.json @@ -34,7 +34,7 @@ ], "moduleNameMapper": { "\\.svg$": "/src/__mocks__/svgMock.js", - "\\.css$": "/src/__mocks__/styleMock.js" + "\\.css$": "identity-obj-proxy" }, "collectCoverageFrom": [ "src/**/*.js", @@ -71,6 +71,7 @@ "html-webpack-plugin": "^2.30.1", "i18next": "^10.3.0", "i18next-browser-languagedetector": "^2.1.0", + "identity-obj-proxy": "^3.0.0", "jest": "^22.2.2", "json-loader": "^0.5.7", "npm-run-all": "^4.1.2", diff --git a/src/__mocks__/styleMock.js b/src/__mocks__/styleMock.js deleted file mode 100644 index f053ebf..0000000 --- a/src/__mocks__/styleMock.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = {}; diff --git a/src/components/Header/__snapshots__/test.js.snap b/src/components/Header/__snapshots__/test.js.snap index f038845..57547e1 100644 --- a/src/components/Header/__snapshots__/test.js.snap +++ b/src/components/Header/__snapshots__/test.js.snap @@ -2,6 +2,7 @@ exports[`Header rendering 1`] = `

diff --git a/src/components/Message/__snapshots__/test.js.snap b/src/components/Message/__snapshots__/test.js.snap index 656df9b..4ad466a 100644 --- a/src/components/Message/__snapshots__/test.js.snap +++ b/src/components/Message/__snapshots__/test.js.snap @@ -2,14 +2,18 @@ exports[`Message rendering 1`] = `
-
+

Testing

-
+

Message content

@@ -19,14 +23,18 @@ exports[`Message rendering 1`] = ` exports[`Message rendering with icon 1`] = `
-
+

Sample icon SVGTesting

-
+

Message content

diff --git a/yarn.lock b/yarn.lock index cf66a73..804eb85 100644 --- a/yarn.lock +++ b/yarn.lock @@ -3366,7 +3366,7 @@ har-validator@~5.0.3: ajv "^5.1.0" har-schema "^2.0.0" -harmony-reflect@^1.4.2: +harmony-reflect@^1.4.2, harmony-reflect@^1.4.6: version "1.5.1" resolved "https://registry.yarnpkg.com/harmony-reflect/-/harmony-reflect-1.5.1.tgz#b54ca617b00cc8aef559bbb17b3d85431dc7e329" @@ -3688,6 +3688,12 @@ icss-utils@^2.1.0: dependencies: postcss "^6.0.1" +identity-obj-proxy@^3.0.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/identity-obj-proxy/-/identity-obj-proxy-3.0.0.tgz#94d2bda96084453ef36fbc5aaec37e0f79f1fc14" + dependencies: + harmony-reflect "^1.4.6" + ieee754@^1.1.4: version "1.1.8" resolved "https://registry.yarnpkg.com/ieee754/-/ieee754-1.1.8.tgz#be33d40ac10ef1926701f6f08a2d86fbfd1ad3e4"