Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions docs/usage/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -115,6 +115,15 @@ This is often used to display for the user and report an error to customer servi
Raven.captureMessage('Broken!')
alert(Raven.lastEventId())


Check if Raven is setup and ready to go
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

.. code-block:: javascript

Raven.isSetup()


Dealing with minified source code
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Expand Down
9 changes: 9 additions & 0 deletions src/raven.js
Original file line number Diff line number Diff line change
Expand Up @@ -323,6 +323,15 @@ var Raven = {
*/
lastEventId: function() {
return lastEventId;
},

/*
* Determine if Raven is setup and ready to go.
*
* @return {boolean}
*/
isSetup: function() {
return isSetup();
}
};

Expand Down
10 changes: 10 additions & 0 deletions test/raven.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -1639,4 +1639,14 @@ describe('Raven (public API)', function() {
assert.isFalse(TraceKit.report.called);
});
});

describe('.isSetup', function() {
it('should work as advertised', function() {
var isSetup = this.sinon.stub(window, 'isSetup');
isSetup.returns(true);
assert.isTrue(Raven.isSetup());
isSetup.returns(false);
assert.isFalse(Raven.isSetup());
});
});
});