@@ -25,6 +25,7 @@ var sourceMapCache = Object.create(null);
2525
2626var sourceMapSupport = require ( 'source-map-support' ) ;
2727sourceMapSupport . install ( {
28+ handleUncaughtExceptions : false ,
2829 retrieveSourceMap : function ( source ) {
2930 if ( sourceMapCache [ source ] ) {
3031 return {
@@ -62,10 +63,6 @@ var options = {
6263// check if test files required ava and show error, when they didn't
6364exports . avaRequired = false ;
6465
65- process . on ( 'uncaughtException' , function ( exception ) {
66- send ( 'uncaughtException' , { exception : serializeError ( exception ) } ) ;
67- } ) ;
68-
6966// try to load an input source map for the test file, in case the file was
7067// already compiled once by the user
7168var inputSourceMap = sourceMapSupport . retrieveSourceMap ( testPath ) ;
@@ -82,6 +79,10 @@ requireFromString(transpiled.code, testPath, {
8279 appendPaths : module . paths
8380} ) ;
8481
82+ process . on ( 'uncaughtException' , function ( exception ) {
83+ send ( 'uncaughtException' , { exception : serializeError ( exception ) } ) ;
84+ } ) ;
85+
8586// if ava was not required, show an error
8687if ( ! exports . avaRequired ) {
8788 send ( 'no-tests' , { avaRequired : false } ) ;
0 commit comments