File tree Expand file tree Collapse file tree 2 files changed +26
-1
lines changed Expand file tree Collapse file tree 2 files changed +26
-1
lines changed Original file line number Diff line number Diff line change
1
+ class LocalStorageMock {
2
+ constructor ( ) {
3
+ this . store = { } ;
4
+ }
5
+
6
+ clear ( ) {
7
+ this . store = { } ;
8
+ }
9
+
10
+ getItem ( key ) {
11
+ return this . store [ key ] ;
12
+ }
13
+
14
+ setItem ( key , value ) {
15
+ this . store [ key ] = value . toString ( ) ;
16
+ }
17
+
18
+ removeItem ( key ) {
19
+ delete this . store [ key ] ;
20
+ }
21
+ } ;
22
+
23
+ global . localStorage = new LocalStorageMock ;
Original file line number Diff line number Diff line change 132
132
"promise" : " 7.1.1" ,
133
133
"react-dev-utils" : " ^0.5.2" ,
134
134
"sass-loader" : " ^6.0.5" ,
135
+ "sinon" : " ^2.3.4" ,
135
136
"style-loader" : " 0.13.1" ,
136
137
"supertest" : " ~3.0.0" ,
137
138
"url-loader" : " 0.5.7" ,
145
146
" src/**/*.{js,jsx}"
146
147
],
147
148
"setupFiles" : [
148
- " <rootDir>/config/polyfills.js"
149
+ " <rootDir>/config/polyfills.js" ,
150
+ " <rootDir>/config/localStorageMock.js"
149
151
],
150
152
"testPathIgnorePatterns" : [
151
153
" <rootDir>[/\\\\ ](build|docs|node_modules|scripts|clicktests)[/\\\\ ]"
You can’t perform that action at this time.
0 commit comments