Error: It looks like you called `mount()` without a global document being loaded

后端 未结 3 1604
借酒劲吻你
借酒劲吻你 2021-01-11 16:44

I\'m trying to mount a component for testing with enzyme, and get this error.

3条回答
  •  陌清茗
    陌清茗 (楼主)
    2021-01-11 17:14

    just put the following in top of your test file

    /**
     * @jest-environment jsdom
    */
    

提交回复
热议问题