Jest: cannot find module required inside module to be tested (relative path)

前端 未结 5 1337
耶瑟儿~
耶瑟儿~ 2021-02-13 15:49

I have this component:

import React from \'react\';
import VideoTag from \'./VideoTag\';
import JWPlayer from \'./JWPlayer\';

class VideoWrapper extends React.C         


        
5条回答
  •  礼貌的吻别
    2021-02-13 16:20

    The problem were not the paths, It was looking for modules only with .js extension, it worked after adding the .jsx in the jest configuration:

    "moduleFileExtensions": [
      "js",
      "jsx"
    ]
    

提交回复
热议问题