File tree Expand file tree Collapse file tree 5 files changed +39
-30
lines changed
src/components/App/__tests__ Expand file tree Collapse file tree 5 files changed +39
-30
lines changed Original file line number Diff line number Diff line change 4
4
"globals": {
5
5
"__DEV__": true
6
6
},
7
+ "env": {
8
+ "browser": true,
9
+ "jest": true
10
+ },
7
11
"rules": {
8
12
"no-confusing-arrow": 0,
9
13
"react/jsx-quotes": 0,
Original file line number Diff line number Diff line change 42
42
"autoprefixer" : " ^6.3.3" ,
43
43
"babel-cli" : " ^6.6.0" ,
44
44
"babel-eslint" : " ^5.0.0" ,
45
+ "babel-jest" : " ^9.0.0" ,
45
46
"babel-loader" : " ^6.2.4" ,
46
47
"babel-plugin-react-transform" : " ^2.0.0" ,
47
48
"babel-plugin-transform-runtime" : " ^6.6.0" ,
53
54
"css-loader" : " ^0.23.1" ,
54
55
"csscomb" : " ^3.1.8" ,
55
56
"del" : " ^2.2.0" ,
57
+ "enzyme" : " ^2.0.0" ,
56
58
"eslint" : " ^2.2.0" ,
57
59
"eslint-config-airbnb" : " ^6.0.2" ,
58
60
"eslint-loader" : " ^1.3.0" ,
59
61
"eslint-plugin-react" : " ^4.1.0" ,
62
+ "estraverse-fb" : " ^1.3.1" ,
60
63
"extend" : " ^3.0.0" ,
61
64
"file-loader" : " ^0.8.5" ,
62
65
"gaze" : " ^0.5.2" ,
63
66
"git-repository" : " ^0.1.1" ,
64
67
"glob" : " ^7.0.0" ,
65
68
"jade-loader" : " ^0.8.0" ,
66
- "jest-cli" : " ^0.8.2 " ,
69
+ "jest-cli" : " ^0.9.0 " ,
67
70
"jscs" : " ^2.11.0" ,
68
71
"json-loader" : " ^0.5.4" ,
69
72
"mkdirp" : " ^0.5.1" ,
74
77
"postcss-scss" : " ^0.1.6" ,
75
78
"precss" : " ^1.4.0" ,
76
79
"raw-loader" : " ^0.5.1" ,
80
+ "react-addons-test-utils" : " ^0.14.7" ,
77
81
"react-transform-catch-errors" : " ^1.0.2" ,
78
82
"react-transform-hmr" : " ^1.0.2" ,
79
83
"redbox-react" : " ^1.2.2" ,
85
89
},
86
90
"jest" : {
87
91
"rootDir" : " ./src" ,
88
- "scriptPreprocessor" : " ../preprocessor.js" ,
92
+ "testPathDirs" : [
93
+ " <rootDir>" ,
94
+ " <rootDir>/../test/"
95
+ ],
96
+ "moduleNameMapper" : {
97
+ "\\ .scss$" : " SCSSStub"
98
+ },
89
99
"unmockedModulePathPatterns" : [
90
- " fbjs " ,
91
- " react "
100
+ " react " ,
101
+ " enzyme "
92
102
]
93
103
},
94
104
"scripts" : {
Load Diff This file was deleted.
Original file line number Diff line number Diff line change
1
+ jest . unmock ( '../App' ) ;
2
+
3
+ import App from '../App' ;
4
+ import React from 'react' ;
5
+ import { shallow } from 'enzyme' ;
6
+
7
+ describe ( 'App' , ( ) => {
8
+ it ( 'renders children correctly' , ( ) => {
9
+ const wrapper = shallow (
10
+ < App context = { { insertCss : ( ) => { } } } >
11
+ < div className = "child" />
12
+ </ App >
13
+ ) ;
14
+ expect ( wrapper . contains ( < div className = "child" /> ) ) . toBe ( true ) ;
15
+ } ) ;
16
+ } ) ;
Original file line number Diff line number Diff line change
1
+ /**
2
+ * @providesModule SCSSStub
3
+ */
4
+
5
+ module . exports = { } ;
You can’t perform that action at this time.
0 commit comments