diff --git a/__mocks__/style.js b/__mocks__/style.js new file mode 100644 index 0000000..b04249f --- /dev/null +++ b/__mocks__/style.js @@ -0,0 +1,4 @@ +// Return a Proxy to emulate css modules (if you are using them) + +var idObj = require('identity-obj-proxy'); +module.exports = idObj; diff --git a/__tests__/Title-test.js b/__tests__/Title-test.js index cc49473..aad3ba9 100644 --- a/__tests__/Title-test.js +++ b/__tests__/Title-test.js @@ -8,7 +8,7 @@ import Title from '../src/components/Title'; describe('Title', () => { - it('changes the text after click', () => { + it('should have a text', () => { // Render a checkbox with label in the document const title = TestUtils.renderIntoDocument( Hello, world! I am a title. diff --git a/package.json b/package.json index f8d6ca8..456e931 100644 --- a/package.json +++ b/package.json @@ -17,6 +17,7 @@ "babel-preset-react": "^6.11.1", "css-loader": "^0.23.1", "extract-text-webpack-plugin": "^1.0.1", + "identity-obj-proxy": "^2.0.0", "jest-cli": "^13.0.0", "react-addons-test-utils": "^15.1.0", "style-loader": "^0.13.1", @@ -28,6 +29,9 @@ "start": "webpack-dev-server" }, "jest": { + "moduleNameMapper": { + "^.+\\.css$": "../../__mocks__/style.js" + }, "unmockedModulePathPatterns": [ "../node_modules/react/", "../node_modules/react-dom/",