2
我有一个应用程序页面的所有测试用例的描述。我有一个包含所有正面测试用例的上下文,然后在其中包含所有负面测试用例的上下文。在所有测试用例之前,我有一个包含登录的测试用例。我想知道我可以添加另一个负面测试用例。我可以在里面有2个描述使用摩卡吗?
例子:
describe('X page', function(){
context('As a user', function(){
before(function(){
login goes here
});
it('Test case 1', function(){
test case implementation goes here
});
it('Test case 2', function(){
test case implementation goes here
});
context('Negative tests', function(){
before(function(){
negative tests precondition goes here
});
it('Test case 1', function(){
test case implementation goes here
});
it('Test case 2', function(){
test case implementation goes here
});
});
});
});
是第二可以去那里过吗?