如何从单个testrunner.html运行两个单独的mocha测试文件?

时间:2017-05-06 10:34:14

标签: mocha

您好:我正在使用html链接testrunner.html从浏览器运行mocha测试。

我有两个mocha测试文件,我想包含在testrunner.html中。可以这样做吗?

如果我必须运行mocha测试via the terminal,我会有一个main.js文件,其中包含mocha测试文件的内容,例如:require('./test1.js')和{{1 }}。有用。

问题是:如果我必须通过单个html文件启动两个mocha测试文件,我该怎么做呢?

test1.js

require('./test2.js')

test2.js

describe('suite1', function(){
    it('case1', function(){...});
    it('case2', function(){...});
});

main.js

describe('suite2', function(){
    it('case1', function(){...});
    it('case2', function(){...});
});

testrunner.html

类似于:testrunner.html

0 个答案:

没有答案