Skip to content

Commit 76639bd

Browse files
committed
Merge pull request #309 from getsentry/issetup
Expose Raven.isSetup
2 parents 2f2ef7e + 6edd5d3 commit 76639bd

File tree

3 files changed

+28
-0
lines changed

3 files changed

+28
-0
lines changed

docs/usage/index.rst

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -115,6 +115,15 @@ This is often used to display for the user and report an error to customer servi
115115
Raven.captureMessage('Broken!')
116116
alert(Raven.lastEventId())
117117
118+
119+
Check if Raven is setup and ready to go
120+
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
121+
122+
.. code-block:: javascript
123+
124+
Raven.isSetup()
125+
126+
118127
Dealing with minified source code
119128
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
120129

src/raven.js

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -323,6 +323,15 @@ var Raven = {
323323
*/
324324
lastEventId: function() {
325325
return lastEventId;
326+
},
327+
328+
/*
329+
* Determine if Raven is setup and ready to go.
330+
*
331+
* @return {boolean}
332+
*/
333+
isSetup: function() {
334+
return isSetup();
326335
}
327336
};
328337

test/raven.test.js

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1639,4 +1639,14 @@ describe('Raven (public API)', function() {
16391639
assert.isFalse(TraceKit.report.called);
16401640
});
16411641
});
1642+
1643+
describe('.isSetup', function() {
1644+
it('should work as advertised', function() {
1645+
var isSetup = this.sinon.stub(window, 'isSetup');
1646+
isSetup.returns(true);
1647+
assert.isTrue(Raven.isSetup());
1648+
isSetup.returns(false);
1649+
assert.isFalse(Raven.isSetup());
1650+
});
1651+
});
16421652
});

0 commit comments

Comments
 (0)