Skip to content

Commit

Permalink
Add test for #647
Browse files Browse the repository at this point in the history
  • Loading branch information
benvinegar committed Jul 8, 2016
1 parent f4c4499 commit 31d99f9
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 1 deletion.
2 changes: 1 addition & 1 deletion test/integration/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@

<!-- Mocking -->
<script src="../../node_modules/sinon/pkg/sinon.js"></script>
<script src="../../dist/raven.js"></script>
<script src="../../build/raven.js"></script>
<script>
beforeEach(function() {
this.sinon = sinon.sandbox.create();
Expand Down
23 changes: 23 additions & 0 deletions test/integration/test.js
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,29 @@ describe('integration', function () {
}
);
});

it('should capture an Error object passed to Raven.captureException w/ maxMessageLength set (#647)', function (done) {
var iframe = this.iframe;
iframeExecute(iframe, done,
function () {
setTimeout(done);

Raven._globalOptions.maxMessageLength = 100;
Raven.captureException(new Error('lol'), {
level: 'warning',
extra: {
foo: 'bar'
}
});
},
function () {
var ravenData = iframe.contentWindow.ravenData[0];
assert.equal(ravenData.exception.type, 'Error');
assert.equal(ravenData.exception.value, 'lol');
assert.equal(ravenData.exception.values[0].stacktrace.frames.length, 1);
}
);
});
});

describe('window.onerror', function () {
Expand Down

0 comments on commit 31d99f9

Please sign in to comment.