cannot find name it in jest typescript

后端 未结 4 1270
Happy的楠姐
Happy的楠姐 2020-12-30 02:40

I try to create an intial setup for jest in react + typescript.I have completed the initial setup and try to check whether the test runs. When i run the test using the comma

4条回答
  •  醉酒成梦
    2020-12-30 03:12

    For me, the problem was that my tsconfig.json was built with

      "include": [
        "src"
      ]
    

    I had to change that to

      "include": [
        "src",
        "tests"
      ]
    

    (My tests all being in directory 'tests')

提交回复
热议问题