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
});
});
});
});
是第二可以去那裏過嗎?