Created
October 23, 2015 21:25
-
-
Save cpojer/72093d149e725a5e6082 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
From 6b55e45d58eb98bb353fbf2087a5c0494e0110e4 Mon Sep 17 00:00:00 2001 | |
From: cpojer <[email protected]> | |
Date: Fri, 23 Oct 2015 14:24:52 -0700 | |
Subject: [PATCH] Fix tests. | |
--- | |
package.json | 11 ++++++++--- | |
src/components/Header/__tests__/Header-test.js | 2 -- | |
src/mocks/css-stub.js | 7 +++++++ | |
3 files changed, 15 insertions(+), 5 deletions(-) | |
create mode 100644 src/mocks/css-stub.js | |
diff --git a/package.json b/package.json | |
index f28d747..5130215 100644 | |
--- a/package.json | |
+++ b/package.json | |
@@ -41,7 +41,7 @@ | |
"gaze": "^0.5.2", | |
"git-repository": "^0.1.1", | |
"glob": "^5.0.15", | |
- "jest-cli": "^0.5.10", | |
+ "jest-cli": "^0.6.0", | |
"jscs": "^2.3.5", | |
"lodash.merge": "^3.3.2", | |
"mkdirp": "^0.5.1", | |
@@ -66,9 +66,14 @@ | |
"jest": { | |
"rootDir": "./src", | |
"scriptPreprocessor": "../preprocessor.js", | |
+ "moduleNameMapper": { | |
+ "[A-z]+\\.css$": "css-stub" | |
+ }, | |
"unmockedModulePathPatterns": [ | |
- "fbjs", | |
- "react" | |
+ "react", | |
+ "react-dom", | |
+ "react-addons-test-utils", | |
+ "fbjs" | |
] | |
}, | |
"scripts": { | |
diff --git a/src/components/Header/__tests__/Header-test.js b/src/components/Header/__tests__/Header-test.js | |
index c2ca832..4b1a08c 100644 | |
--- a/src/components/Header/__tests__/Header-test.js | |
+++ b/src/components/Header/__tests__/Header-test.js | |
@@ -1,7 +1,5 @@ | |
jest.dontMock('../Header'); | |
jest.dontMock('../../../decorators/withStyles.js'); | |
-jest.setMock('../Header.css', {use: function noop() {}, unuse: function noop() {}}); | |
- | |
import React from 'react'; | |
import TestUtils from 'react-addons-test-utils'; | |
diff --git a/src/mocks/css-stub.js b/src/mocks/css-stub.js | |
new file mode 100644 | |
index 0000000..537da2e | |
--- /dev/null | |
+++ b/src/mocks/css-stub.js | |
@@ -0,0 +1,7 @@ | |
+/** | |
+ * @providesModule css-stub | |
+ */ | |
+ | |
+console.log('hey ho, let\'s go!'); | |
+ | |
+module.exports = {use: function noop() {}, unuse: function noop() {}}; | |
-- | |
2.6.2+GitX |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment