2
私は1つのアプリページのすべてのテストケースについて説明しています。私は、すべての肯定的なテストケースを含むコンテキストを持っており、その中にはすべての否定的なテストケースを含むコンテキストがあります。すべてのテストケースの前に、その前にログインが含まれています。私は否定的なテストケースのために前もって別のものを追加できることを知りたい。モカを使用して説明する前に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
});
});
});
});
は、第2の前にそこに行くことはできますか?