NervJS / nerv

A blazing fast React alternative, compatible with IE8 and React 16.

Home Page:https://nerv.aotu.io

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

jest 多个Effect的时候报错

zhanglong-3ti opened this issue · comments

主要代码:

useEffect(() => {
  setTitle('主页');
   }, []);
 useEffect(() => {
   setIsLoaded(false);
 }, [dateRange])

jest代码:

const component = renderIntoDocument(<homePage/>);
expect(component).toMatchSnapshot();

发现只要写多个useEffect, 然后进行单元测试就会报错,错误信息是ReferenceError: Taro is not defined

版本:

"nervjs": "^1.4.0",
"nerv-test-utils": "^1.4.3",
"@tarojs/taro": "1.3.14",

请问这个问题如何解决呢?