在我的反应应用程序使用笑话,描述是不定义的

我是一个开玩笑的新手,我尝试在下面的代码中找出一些基本的东西

import * as actions from './IncrementalSearchActions';


describe('Incremental Search Actions', () => {
it('Should create an incremental search action')
});

我对此的疑问/困惑是

  1. 我得到一个错误说描述没有定义,我如何导入所需的模块?
  2. 这是用来搭配卡玛和茉莉的吗?
44350 次浏览

Are your test files under a the "test" folder? make sure jest is install properly and listed on your package.json and under scripts have:

"test": "jest --coverage",

you can run the script with npm test

I believe the answer here is the answer to your question.

TL;DR;:

add the following to your .eslintrc file:

"env": {
"jest": true
}