Skip to content

armgit / mocha

Public Imported from GitHub
0

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

changed hook test to not use "exit" event

Tj Holowaychuk56fcaa4d8f17
diff --git a/test/unit/hook.async.js b/test/unit/hook.async.js
index 100a2ccf..2ffd6c98 100644
--- a/test/unit/hook.async.js
+++ b/test/unit/hook.async.js
@@ -2,21 +2,6 @@
describe('async', function(){
var calls = [];
- process.on('exit', function(){
- calls.should.eql([
- 'before all'
- , 'before'
- , 'one'
- , 'after'
- , 'before'
- , 'two'
- , 'after'
- , 'before'
- , 'three'
- , 'after'
- , 'after all']);
- })
-
beforeEach(function(){
// not hit
calls.push('parent before');
@@ -80,5 +65,20 @@ describe('async', function(){
done();
})
})
+
+ after(function(){
+ calls.should.eql([
+ 'before all'
+ , 'before'
+ , 'one'
+ , 'after'
+ , 'before'
+ , 'two'
+ , 'after'
+ , 'before'
+ , 'three'
+ , 'after'
+ , 'after all']);
+ })
})
})