Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/node.js/37.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Node.js 包括描述块内描述块,摩卡_Node.js_Testing_Mocha.js_Puppeteer - Fatal编程技术网

Node.js 包括描述块内描述块,摩卡

Node.js 包括描述块内描述块,摩卡,node.js,testing,mocha.js,puppeteer,Node.js,Testing,Mocha.js,Puppeteer,我试图在描述测试套件中包含一个描述块,如下所示: test = () => { describe('test', () => { it('test', () => {}) }); describe('general test', () => { it('some test', () => {}) it('some test', () => {}) describe('sometest',() => { tes

我试图在描述测试套件中包含一个描述块,如下所示:

test = () => {
  describe('test', () => {
    it('test', () => {})
});


describe('general test', () => {
   it('some test', () => {})
   it('some test', () => {})
   describe('sometest',() => {
      test(); 
   })
   it('continue general test', () => {});
})

那么,您面临的问题是什么?您是否有理由尝试使用函数而不是直接将其写入描述块中?是的,我在不同的场景中重复相同的测试,我不想重复代码,第二个描述块异步运行,第一个描述块保持运行。