@@ -166,8 +166,6 @@ test('uncaught exception will be reported to console', function (t) {
166
166
execCli ( 'fixture/uncaught-exception.js' , function ( err , stdout , stderr ) {
167
167
t . ok ( err ) ;
168
168
t . true ( / C a n ' t c a t c h m e ! / . test ( stderr ) ) ;
169
- t . match ( stderr , / ^ .* ?a t .* ?b a r \b .* u n c a u g h t - e x c e p t i o n .j s : 1 2 .* $ / m) ;
170
- t . match ( stderr , / ^ .* ?a t .* ?f o o \b .* u n c a u g h t - e x c e p t i o n .j s : 8 .* $ / m) ;
171
169
// TODO(jamestalmage): This should get printed, but we reject the promise (ending all tests) instead of just ending that one test and reporting.
172
170
// t.ok(/1 uncaught exception[^s]/.test(stdout));
173
171
t . end ( ) ;
@@ -194,6 +192,26 @@ test('throwing a anonymous function will report the function to the console', fu
194
192
} ) ;
195
193
} ) ;
196
194
195
+ test ( 'stack traces for exceptions are corrected using a source map' , function ( t ) {
196
+ execCli ( 'fixture/source-map-exception.js' , function ( err , stdout , stderr ) {
197
+ t . ok ( err ) ;
198
+ t . true ( / C a n ' t c a t c h m e ! / . test ( stderr ) ) ;
199
+ t . match ( stderr , / ^ .* ?a t .* ?b a r \b .* s o u r c e - m a p - e x c e p t i o n .j s : 1 2 .* $ / m) ;
200
+ t . match ( stderr , / ^ .* ?a t .* ?f o o \b .* s o u r c e - m a p - e x c e p t i o n .j s : 8 .* $ / m) ;
201
+ t . end ( ) ;
202
+ } ) ;
203
+ } ) ;
204
+
205
+ test ( 'stack traces for exceptions are corrected using a source map, found via a pragma' , function ( t ) {
206
+ execCli ( 'fixture/source-map-pragma-exception.js' , function ( err , stdout , stderr ) {
207
+ t . ok ( err ) ;
208
+ t . true ( / C a n ' t c a t c h m e ! / . test ( stderr ) ) ;
209
+ t . match ( stderr , / ^ .* ?a t .* ?b a r \b .* s o u r c e - w i t h - s o u r c e - m a p - p r a g m a .j s : 8 .* $ / m) ;
210
+ t . match ( stderr , / ^ .* ?a t .* ?f o o \b .* s o u r c e - w i t h - s o u r c e - m a p - p r a g m a .j s : 4 .* $ / m) ;
211
+ t . end ( ) ;
212
+ } ) ;
213
+ } ) ;
214
+
197
215
test ( 'absolute paths in CLI' , function ( t ) {
198
216
t . plan ( 2 ) ;
199
217
0 commit comments