@@ -246,12 +246,6 @@ describe('globals', function() {
246246
247247 describe ( 'normalizeFrame' , function ( ) {
248248 it ( 'should handle a normal frame' , function ( ) {
249- var context = [
250- [ 'line1' ] , // pre
251- 'line2' , // culprit
252- [ 'line3' ] // post
253- ] ;
254- this . sinon . stub ( Raven , '_extractContextFromFrame' ) . returns ( context ) ;
255249 var frame = {
256250 url : 'http://example.com/path/file.js' ,
257251 line : 10 ,
@@ -267,25 +261,18 @@ describe('globals', function() {
267261 lineno : 10 ,
268262 colno : 11 ,
269263 'function' : 'lol' ,
270- pre_context : [ 'line1' ] ,
271- context_line : 'line2' ,
272- post_context : [ 'line3' ] ,
273264 in_app : true
274265 } ) ;
275266 } ) ;
276267
277268 it ( 'should handle a frame without context' , function ( ) {
278- this . sinon . stub ( Raven , '_extractContextFromFrame' ) . returns ( undefined ) ;
279269 var frame = {
280270 url : 'http://example.com/path/file.js' ,
281271 line : 10 ,
282272 column : 11 ,
283273 func : 'lol'
284- // context: [] context is stubbed
285274 } ;
286275
287- Raven . _globalOptions . fetchContext = true ;
288-
289276 assert . deepEqual ( Raven . _normalizeFrame ( frame ) , {
290277 filename : 'http://example.com/path/file.js' ,
291278 lineno : 10 ,
@@ -296,13 +283,11 @@ describe('globals', function() {
296283 } ) ;
297284
298285 it ( 'should not mark `in_app` if rules match' , function ( ) {
299- this . sinon . stub ( Raven , '_extractContextFromFrame' ) . returns ( undefined ) ;
300286 var frame = {
301287 url : 'http://example.com/path/file.js' ,
302288 line : 10 ,
303289 column : 11 ,
304290 func : 'lol'
305- // context: [] context is stubbed
306291 } ;
307292
308293 Raven . _globalOptions . fetchContext = true ;
@@ -318,13 +303,11 @@ describe('globals', function() {
318303 } ) ;
319304
320305 it ( 'should mark `in_app` if rules do not match' , function ( ) {
321- this . sinon . stub ( Raven , '_extractContextFromFrame' ) . returns ( undefined ) ;
322306 var frame = {
323307 url : 'http://lol.com/path/file.js' ,
324308 line : 10 ,
325309 column : 11 ,
326310 func : 'lol'
327- // context: [] context is stubbed
328311 } ;
329312
330313 Raven . _globalOptions . fetchContext = true ;
@@ -340,13 +323,11 @@ describe('globals', function() {
340323 } ) ;
341324
342325 it ( 'should mark `in_app` for raven.js' , function ( ) {
343- this . sinon . stub ( Raven , '_extractContextFromFrame' ) . returns ( undefined ) ;
344326 var frame = {
345327 url : 'http://lol.com/path/raven.js' ,
346328 line : 10 ,
347329 column : 11 ,
348330 func : 'lol'
349- // context: [] context is stubbed
350331 } ;
351332
352333 assert . deepEqual ( Raven . _normalizeFrame ( frame ) , {
@@ -359,13 +340,11 @@ describe('globals', function() {
359340 } ) ;
360341
361342 it ( 'should mark `in_app` for raven.min.js' , function ( ) {
362- this . sinon . stub ( Raven , '_extractContextFromFrame' ) . returns ( undefined ) ;
363343 var frame = {
364344 url : 'http://lol.com/path/raven.min.js' ,
365345 line : 10 ,
366346 column : 11 ,
367347 func : 'lol'
368- // context: [] context is stubbed
369348 } ;
370349
371350 assert . deepEqual ( Raven . _normalizeFrame ( frame ) , {
@@ -378,13 +357,11 @@ describe('globals', function() {
378357 } ) ;
379358
380359 it ( 'should mark `in_app` for Raven' , function ( ) {
381- this . sinon . stub ( Raven , '_extractContextFromFrame' ) . returns ( undefined ) ;
382360 var frame = {
383361 url : 'http://lol.com/path/file.js' ,
384362 line : 10 ,
385363 column : 11 ,
386364 func : 'Raven.wrap'
387- // context: [] context is stubbed
388365 } ;
389366
390367 assert . deepEqual ( Raven . _normalizeFrame ( frame ) , {
@@ -397,13 +374,11 @@ describe('globals', function() {
397374 } ) ;
398375
399376 it ( 'should mark `in_app` for TraceKit' , function ( ) {
400- this . sinon . stub ( Raven , '_extractContextFromFrame' ) . returns ( undefined ) ;
401377 var frame = {
402378 url : 'http://lol.com/path/file.js' ,
403379 line : 10 ,
404380 column : 11 ,
405381 func : 'TraceKit.lol'
406- // context: [] context is stubbed
407382 } ;
408383
409384 assert . deepEqual ( Raven . _normalizeFrame ( frame ) , {
@@ -416,95 +391,17 @@ describe('globals', function() {
416391 } ) ;
417392
418393 it ( 'should not blow up if includePaths is empty, regression for #377' , function ( ) {
419- this . sinon . stub ( Raven , '_extractContextFromFrame' ) . returns ( undefined ) ;
420394 var frame = {
421395 url : 'http://lol.com/path/file.js' ,
422396 line : 10 ,
423397 column : 11 ,
424398 func : 'TraceKit.lol'
425- // context: [] context is stubbed
426399 } ;
427400 Raven . _globalOptions . includePaths = [ ] ;
428401 Raven . _normalizeFrame ( frame ) ;
429402 } ) ;
430403 } ) ;
431404
432- describe ( 'extractContextFromFrame' , function ( ) {
433- it ( 'should handle a normal frame' , function ( ) {
434- var frame = {
435- column : 2 ,
436- context : [
437- 'line1' ,
438- 'line2' ,
439- 'line3' ,
440- 'line4' ,
441- 'line5' ,
442- 'culprit' ,
443- 'line7' ,
444- 'line8' ,
445- 'line9' ,
446- 'line10' ,
447- 'line11'
448- ]
449- } ;
450- var context = Raven . _extractContextFromFrame ( frame ) ;
451- assert . deepEqual ( context , [
452- [ 'line1' , 'line2' , 'line3' , 'line4' , 'line5' ] ,
453- 'culprit' ,
454- [ 'line7' , 'line8' , 'line9' , 'line10' , 'line11' ]
455- ] ) ;
456- } ) ;
457-
458- it ( 'should return nothing if there is no context' , function ( ) {
459- var frame = {
460- column : 2
461- } ;
462- assert . isUndefined ( Raven . _extractContextFromFrame ( frame ) ) ;
463- } ) ;
464-
465- it ( 'should reject a context if a line is too long without a column' , function ( ) {
466- var frame = {
467- context : [
468- new Array ( 1000 ) . join ( 'f' ) // generate a line that is 1000 chars long
469- ]
470- } ;
471- assert . isUndefined ( Raven . _extractContextFromFrame ( frame ) ) ;
472- } ) ;
473-
474- it ( 'should reject a minified context with fetchContext disabled' , function ( ) {
475- var frame = {
476- column : 2 ,
477- context : [
478- 'line1' ,
479- 'line2' ,
480- 'line3' ,
481- 'line4' ,
482- 'line5' ,
483- 'culprit' ,
484- 'line7' ,
485- 'line8' ,
486- 'line9' ,
487- 'line10' ,
488- 'line11'
489- ]
490- } ;
491- Raven . _globalOptions . fetchContext = false ;
492- assert . isUndefined ( Raven . _extractContextFromFrame ( frame ) ) ;
493- } ) ;
494-
495- it ( 'should truncate the minified line if there is a column number without sourcemaps enabled' , function ( ) {
496- // Note to future self:
497- // Array(51).join('f').length === 50
498- var frame = {
499- column : 2 ,
500- context : [
501- 'aa' + ( new Array ( 51 ) . join ( 'f' ) ) + ( new Array ( 500 ) . join ( 'z' ) )
502- ]
503- } ;
504- assert . deepEqual ( Raven . _extractContextFromFrame ( frame ) , [ [ ] , new Array ( 51 ) . join ( 'f' ) , [ ] ] ) ;
505- } ) ;
506- } ) ;
507-
508405 describe ( 'processException' , function ( ) {
509406 it ( 'should respect `ignoreErrors`' , function ( ) {
510407 this . sinon . stub ( Raven , '_send' ) ;
0 commit comments