Skip to content

Commit bd1da7c

Browse files
committed
fix the crash caused by node test part
1 parent c7b81f2 commit bd1da7c

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

tests/automatic_tests/node/mocha_test.js

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,10 +32,14 @@ describe('require', function() {
3232

3333
describe('node', function() {
3434

35+
var mocha_callback = null;
3536
before(function() {
36-
var mocha_callback = process.listeners('uncaughtException')[1];
37+
mocha_callback = process.listeners('uncaughtException')[1];
3738
process.removeListener('uncaughtException', mocha_callback);
3839
});
40+
after(function(){
41+
process.on('uncaughtException',mocha_callback);
42+
})
3943

4044
describe('process', function() {
4145
it('uncaughtException should have a default listener', function() {

0 commit comments

Comments
 (0)