Skip to content

Expose Raven.isSetup #309

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Dec 29, 2014
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());
});
});
});