为什么嵌套的 mocha 测试套件不是 运行 而 mocha 是 运行 with --recursive 标志
Why are nested mocha test suites not run when mocha is run with --recursive flag
以下 mocha 嵌套测试套件结构与预期的一样 运行:
mocha --timeout 25000 test.js
describe('test suite 1', function() {
it('unit test 1', (done) => {
describe('test suite 2', function() {
it('unit test 2') {
describe('test suite 3', function() {
it('unit test 3') {
我不明白为什么测试 运行 时情况并非如此:
mocha --recursive --timeout 25000
查看调试日志我可以清楚地看到 it 2
和 it 3
不是 运行。我必须使用 mocha --recursive --timeout 25000
因为我有更多的测试套件文件。
Mocha 不支持您在问题中显示的结构。涵盖各种情况:
describe
里面describe
?很好
it
里面describe
?很好
describe
里面it
?摩卡不支持这个。结果未定义。如果你得到了你期望的结果,那是运气。
it
里面it
?同样,摩卡不支持。结果未定义。
以下 mocha 嵌套测试套件结构与预期的一样 运行:
mocha --timeout 25000 test.js
describe('test suite 1', function() {
it('unit test 1', (done) => {
describe('test suite 2', function() {
it('unit test 2') {
describe('test suite 3', function() {
it('unit test 3') {
我不明白为什么测试 运行 时情况并非如此:
mocha --recursive --timeout 25000
查看调试日志我可以清楚地看到 it 2
和 it 3
不是 运行。我必须使用 mocha --recursive --timeout 25000
因为我有更多的测试套件文件。
Mocha 不支持您在问题中显示的结构。涵盖各种情况:
describe
里面describe
?很好it
里面describe
?很好describe
里面it
?摩卡不支持这个。结果未定义。如果你得到了你期望的结果,那是运气。it
里面it
?同样,摩卡不支持。结果未定义。