Skip to content

Commit 31d99f9

Browse files
committed
Add test for #647
1 parent f4c4499 commit 31d99f9

File tree

2 files changed

+24
-1
lines changed

2 files changed

+24
-1
lines changed

test/integration/index.html

+1-1
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818

1919
<!-- Mocking -->
2020
<script src="../../node_modules/sinon/pkg/sinon.js"></script>
21-
<script src="../../dist/raven.js"></script>
21+
<script src="../../build/raven.js"></script>
2222
<script>
2323
beforeEach(function() {
2424
this.sinon = sinon.sandbox.create();

test/integration/test.js

+23
Original file line numberDiff line numberDiff line change
@@ -78,6 +78,29 @@ describe('integration', function () {
7878
}
7979
);
8080
});
81+
82+
it('should capture an Error object passed to Raven.captureException w/ maxMessageLength set (#647)', function (done) {
83+
var iframe = this.iframe;
84+
iframeExecute(iframe, done,
85+
function () {
86+
setTimeout(done);
87+
88+
Raven._globalOptions.maxMessageLength = 100;
89+
Raven.captureException(new Error('lol'), {
90+
level: 'warning',
91+
extra: {
92+
foo: 'bar'
93+
}
94+
});
95+
},
96+
function () {
97+
var ravenData = iframe.contentWindow.ravenData[0];
98+
assert.equal(ravenData.exception.type, 'Error');
99+
assert.equal(ravenData.exception.value, 'lol');
100+
assert.equal(ravenData.exception.values[0].stacktrace.frames.length, 1);
101+
}
102+
);
103+
});
81104
});
82105

83106
describe('window.onerror', function () {

0 commit comments

Comments
 (0)