Skip to content
Merged
Show file tree
Hide file tree
Changes from 3 commits
Commits
Show all changes
23 commits
Select commit Hold shift + click to select a range
ef30661
polished raven.d.ts
LucaVazz Jan 12, 2017
98a83c1
updated author information of raven.d.ts
LucaVazz Jan 12, 2017
2e590d2
added extra to RavenUserContext
LucaVazz Jan 12, 2017
cc9fc47
small fixes
LucaVazz Jan 12, 2017
592e542
copied fixes from PR in DefenitivelyTyped
LucaVazz Jan 13, 2017
089efdd
fixed tsc --noEmit --noImplicitAny typescript/raven-tests.ts
LucaVazz Jan 23, 2017
305d38b
made `data: any` in set...Calback more specific
LucaVazz Jan 24, 2017
949bc5d
added missing values to RavenOutgoingData
LucaVazz Jan 24, 2017
d0d32c8
replaced any in setBreadcrumbCallback
LucaVazz Jan 24, 2017
e562d5c
made options for setTransport more specific
LucaVazz Jan 24, 2017
a53a044
set user in RavenOutgoingData to RavenUserContext instead of any
LucaVazz Jan 24, 2017
f46fde8
fixed missed RavenTransportOptions (-> RavenTransportFunctionOptions …
LucaVazz Jan 24, 2017
7fdef1f
fixed interface-props terminated by `;` to be terminated by `;`
LucaVazz Jan 24, 2017
9f38a30
Merge branch 'master' of https://github.com/getsentry/raven-js
LucaVazz Jan 24, 2017
1f55f01
re-added accidentally deleted tests (in a fixed version)
LucaVazz Jan 31, 2017
3e51fc6
fixed typo in RavenBreadcrumbOptions
LucaVazz Jan 31, 2017
ac60fe3
added a proposal for a PR-Template
LucaVazz Jan 31, 2017
10d48cc
removed redundant testing from the PR-Template
LucaVazz Jan 31, 2017
60a7809
fix optionals in RavenBreadcrumb
LucaVazz Feb 16, 2017
5e92191
added tests for captureBreadcrumb
LucaVazz Feb 16, 2017
634908c
fixed erroneous optionals from the last commit
LucaVazz Feb 16, 2017
d8941cf
removed PR-Template
LucaVazz Feb 19, 2017
e034ba6
Merge branch 'master' of https://github.com/LucaVazz/raven-js
LucaVazz Feb 19, 2017
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
27 changes: 27 additions & 0 deletions .github/PULL_REQUEST_TEMPLATE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
***Status:***
- [ ] ready
- [ ] work in progress
- [ ] hold


**What is the purpose of this PR?**


**Is this related to an Issue? (If so, please link to it)**


**How should this be manually tested?**


***Checklist:***
- [ ] I have included appropriate Tests and have run `npm test` without errors
- [ ] I have updated the Documentation accordingly
- [ ] I updated typings/raven.d.ts if I added to or changed the API and have run `tsc --noEmit --noImplicitAny typescript/raven-tests.ts` without errors
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We can probably make this a script like npm run test:ts, or make it called by npm test directly

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I just noticed that in fact it already is called directly by npm test 😁


Please note: If you are not able to fulfill these points by yourself, leave them unchecked. We are happy to help you with them.


***Release Type:***
- [ ] Major
- [ ] Minor
- [X] Patch
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please remove this.

55 changes: 38 additions & 17 deletions typescript/raven-tests.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import Raven from "./raven"

import Raven, {RavenOutgoingData} from "./raven"

// configuring:
Raven.config('https://[email protected]/1').install();

Raven.config(
Expand All @@ -20,32 +20,54 @@ Raven.config(
}
).install();

var throwsError = () => {
throw new Error('broken');
};
Raven.setDataCallback((data: RavenOutgoingData) => {return data});
Raven.setDataCallback(function (data: RavenOutgoingData, original: string) {return data});

Raven.setShouldSendCallback((data: RavenOutgoingData) => {return data});
Raven.setShouldSendCallback(function (data: RavenOutgoingData, original: string) {return data});

try {
throwsError();
} catch(e) {
Raven.captureException(e);
Raven.captureException(e, {tags: { key: "value" }});
}

// context:
Raven.context(throwsError);
Raven.context({tags: { key: "value" }}, throwsError);
Raven.context({extra: {planet: {name: 'Earth'}}}, throwsError);

setTimeout(Raven.wrap(throwsError), 1000);
Raven.wrap({logger: "my.module"}, throwsError)();
Raven.wrap({tags: {git_commit: 'c0deb10c4'}}, throwsError)();

Raven.setUserContext({
email: '[email protected]',
id: '123'
});

Raven.setExtraContext({foo: 'bar'});

Raven.setTagsContext({env: 'prod'});

Raven.clearContext();

var obj:Object = Raven.getContext();

Raven.setRelease('abc123');
Raven.setEnvironment('production');

setTimeout(Raven.wrap(throwsError), 1000);
Raven.wrap({logger: "my.module"}, throwsError)();
Raven.wrap({tags: {git_commit: 'c0deb10c4'}}, throwsError)();


// reporting:
var throwsError = () => {
throw new Error('broken');
};

try {
throwsError();
} catch(e) {
Raven.captureException(e);
Raven.captureException(e, {tags: { key: "value" }});
}

Raven.captureMessage('Broken!');
Raven.captureMessage('Broken!', {tags: { key: "value" }});
Raven.captureMessage('Broken!', { stacktrace: true });

Raven.showReportDialog({
eventId: 0815,
Expand All @@ -56,6 +78,5 @@ Raven.showReportDialog({
}
});

Raven.setTagsContext({ key: "value" });

Raven.setExtraContext({ foo: "bar" });
var err:Error = Raven.lastException();
10 changes: 5 additions & 5 deletions typescript/raven.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -152,19 +152,19 @@ interface RavenStatic {
* Specify a callback function that can mutate or filter breadcrumbs when they are captured.
* @param callback The function which applies the filter
*/
setBreadcrumbCallback(callback :(data: RavenBreadcrumb, orig?: string) => RavenBreadcrumb):RavenStatic;
setBreadcrumbCallback(callback: (data: RavenBreadcrumb, original?: string) => RavenBreadcrumb):RavenStatic;

/**
* Specify a function that can mutate the payload right before it is being sent to Sentry.
* @param callback The function which can mutate the data
*/
setDataCallback(callback: (data: RavenOutgoingData, orig?: string) => RavenOutgoingData): RavenStatic;
setDataCallback(callback: (data: RavenOutgoingData, original?: string) => RavenOutgoingData): RavenStatic;

/**
* Specify a callback function that determines if the given message should be sent to Sentry.
* @param callback The function which determines if the given blob should be sent
*/
setShouldSendCallback(callback: (data: RavenOutgoingData, orig?: string) => RavenOutgoingData): RavenStatic;
setShouldSendCallback(callback: (data: RavenOutgoingData, original?: string) => RavenOutgoingData): RavenStatic;

/**
* Override the default HTTP data transport handler.
Expand Down Expand Up @@ -196,7 +196,7 @@ interface RavenStatic {


// --- Helper Interfaces for Options --------------
export interface RavenBreadcrumOptions {
export interface RavenBreadcrumbOptions {
/** Whether to collect XHR calls, defaults to true */
xhr?: boolean;

Expand Down Expand Up @@ -254,7 +254,7 @@ export interface RavenGlobalOptions extends CommonRavenOptions {
serverName?: string;

/** Configures which breadcrumbs are collected automatically */
autoBreadcrumbs?: boolean | RavenBreadcrumOptions;
autoBreadcrumbs?: boolean | RavenBreadcrumbOptions;

/** Whether to collect errors on the window via TraceKit.collectWindowErrors. Default: true. */
collectWindowErrors?: boolean;
Expand Down