Skip to content

Commit 2185a95

Browse files
committed
Backfill tests for #216
1 parent 0e34652 commit 2185a95

File tree

1 file changed

+76
-0
lines changed

1 file changed

+76
-0
lines changed

test/raven.test.js

Lines changed: 76 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -380,6 +380,82 @@ describe('globals', function() {
380380
in_app: false
381381
});
382382
});
383+
384+
it('should mark `in_app` for raven.js', function() {
385+
this.sinon.stub(window, 'extractContextFromFrame').returns(undefined);
386+
var frame = {
387+
url: 'http://lol.com/path/raven.js',
388+
line: 10,
389+
column: 11,
390+
func: 'lol'
391+
// context: [] context is stubbed
392+
};
393+
394+
assert.deepEqual(normalizeFrame(frame), {
395+
filename: 'http://lol.com/path/raven.js',
396+
lineno: 10,
397+
colno: 11,
398+
'function': 'lol',
399+
in_app: false
400+
});
401+
});
402+
403+
it('should mark `in_app` for raven.min.js', function() {
404+
this.sinon.stub(window, 'extractContextFromFrame').returns(undefined);
405+
var frame = {
406+
url: 'http://lol.com/path/raven.min.js',
407+
line: 10,
408+
column: 11,
409+
func: 'lol'
410+
// context: [] context is stubbed
411+
};
412+
413+
assert.deepEqual(normalizeFrame(frame), {
414+
filename: 'http://lol.com/path/raven.min.js',
415+
lineno: 10,
416+
colno: 11,
417+
'function': 'lol',
418+
in_app: false
419+
});
420+
});
421+
422+
it('should mark `in_app` for Raven', function() {
423+
this.sinon.stub(window, 'extractContextFromFrame').returns(undefined);
424+
var frame = {
425+
url: 'http://lol.com/path/file.js',
426+
line: 10,
427+
column: 11,
428+
func: 'Raven.wrap'
429+
// context: [] context is stubbed
430+
};
431+
432+
assert.deepEqual(normalizeFrame(frame), {
433+
filename: 'http://lol.com/path/file.js',
434+
lineno: 10,
435+
colno: 11,
436+
'function': 'Raven.wrap',
437+
in_app: false
438+
});
439+
});
440+
441+
it('should mark `in_app` for TraceKit', function() {
442+
this.sinon.stub(window, 'extractContextFromFrame').returns(undefined);
443+
var frame = {
444+
url: 'http://lol.com/path/file.js',
445+
line: 10,
446+
column: 11,
447+
func: 'TraceKit.lol'
448+
// context: [] context is stubbed
449+
};
450+
451+
assert.deepEqual(normalizeFrame(frame), {
452+
filename: 'http://lol.com/path/file.js',
453+
lineno: 10,
454+
colno: 11,
455+
'function': 'TraceKit.lol',
456+
in_app: false
457+
});
458+
});
383459
});
384460

385461
describe('extractContextFromFrame', function() {

0 commit comments

Comments
 (0)