Skip to content

Commit 44015cb

Browse files
committed
add test for deep wrapping
1 parent 7e17ce4 commit 44015cb

File tree

1 file changed

+11
-1
lines changed

1 file changed

+11
-1
lines changed

test/raven.test.js

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1040,7 +1040,7 @@ describe('Raven (public API)', function() {
10401040
});
10411041

10421042
it('should return the result of a wrapped function', function() {
1043-
var func = function() { return 'foo' };
1043+
var func = function() { return 'foo'; };
10441044
var wrapped = Raven.wrap(func);
10451045
assert.equal(wrapped(), 'foo');
10461046
});
@@ -1063,6 +1063,16 @@ describe('Raven (public API)', function() {
10631063
assert.isTrue(spy.calledOnce);
10641064
});
10651065

1066+
it('should not wrap function arguments', function() {
1067+
var spy = this.sinon.spy();
1068+
var wrapped = Raven.wrap({ deep: false }, function(f) {
1069+
assert.isTrue(f.__raven__);
1070+
f();
1071+
});
1072+
wrapped(spy);
1073+
assert.isFalse(spy.calledOnce);
1074+
});
1075+
10661076
it('should maintain the correct scope', function() {
10671077
var foo = {};
10681078
var bar = function() {

0 commit comments

Comments
 (0)