1
2
|
jest node[20471] (FSEvents.framework) FSEventStreamStart: register_with_server: ERROR: f2d_register_rpc() => (null) (-22)
|
相关问题:[https://github.com/facebook/jest/issues/1767]
解决:升级watchman
1
2
3
4
5
6
7
8
9
10
11
12
13
14
|
● Test suite failed to run
ReferenceError: document is not defined
at Object.<anonymous> (node_modules/bizcharts/umd/BizCharts.js:21580:13)
at __webpack_require__ (node_modules/bizcharts/umd/BizCharts.js:30:30)
at Object.<anonymous> (node_modules/bizcharts/umd/BizCharts.js:20927:14)
at __webpack_require__ (node_modules/bizcharts/umd/BizCharts.js:30:30)
at Object.<anonymous> (node_modules/bizcharts/umd/BizCharts.js:145:18)
at __webpack_require__ (node_modules/bizcharts/umd/BizCharts.js:30:30)
at Object.<anonymous> (node_modules/bizcharts/umd/BizCharts.js:41728:12)
at __webpack_require__ (node_modules/bizcharts/umd/BizCharts.js:30:30)
at Object.<anonymous> (node_modules/bizcharts/umd/BizCharts.js:4442:11)
at __webpack_require__ (node_modules/bizcharts/umd/BizCharts.js:30:30)
|
解决:webstorm的 Jest options 加入 --env=jsdom
- localstorage not defined
解决:mock一下
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
|
class LocalStorageMock {
constructor() {
this.store = {};
}
clear() {
this.store = {};
}
getItem(key) {
return this.store[key] || null;
}
setItem(key, value) {
this.store[key] = value.toString();
}
removeItem(key) {
delete this.store[key];
}
};
global.localStorage = new LocalStorageMock;
|