Skip to content

armgit / mocha

Public Imported from GitHub
0

☕️ Classic, reliable, trusted test framework for Node.js and the browser

fixing some hook tests

TJ Holowaychukd95c69146932
diff --git a/test/hook.sync.js b/test/hook.sync.js
index d5ad9936..e30037a1 100644
--- a/test/hook.sync.js
+++ b/test/hook.sync.js
@@ -3,12 +3,10 @@ describe('serial', function(){
var calls = [];
beforeEach(function(){
- // not hit
calls.push('parent before');
})
afterEach(function(){
- // not hit
calls.push('parent after');
})
@@ -18,27 +16,35 @@ describe('serial', function(){
})
it('one', function(){
- calls.should.eql(['before']);
+ calls.should.eql(['parent before', 'before']);
calls.push('one');
})
it('two', function(){
calls.should.eql([
- 'before'
+ 'parent before'
+ , 'before'
, 'one'
, 'after'
+ , 'parent after'
+ , 'parent before'
, 'before']);
calls.push('two');
})
it('three', function(){
calls.should.eql([
- 'before'
+ 'parent before'
+ , 'before'
, 'one'
, 'after'
+ , 'parent after'
+ , 'parent before'
, 'before'
, 'two'
, 'after'
+ , 'parent after'
+ , 'parent before'
, 'before']);
calls.push('three');
})