Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
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
22 changes: 21 additions & 1 deletion typescript/raven-tests.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,17 +2,37 @@ import Raven, {RavenOptions} from '..';

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

// Test regex options
var options: RavenOptions = {
logger: 'my-logger',
ignoreUrls: [
/graph\.facebook\.com/i
],
ignoreErrors: [
'fb_xd_fragment'
/fb_xd_fragment/
],
includePaths: [
/https?:\/\/(www\.)?getsentry\.com/,
/https?:\/\/d3nslu0hdya83q\.cloudfront\.net/
],
whitelistUrls: [
/https?:\/\/google\.com/
]
};

// Test string params
options = {
ignoreUrls: [
'graph.facebook.com'
],
ignoreErrors: [
'fb_xd_fragment'
],
includePaths: [
'https://www.getsentry.com'
],
whitelistUrls: [
'https://www.google.com'
]
};

Expand Down
8 changes: 4 additions & 4 deletions typescript/raven.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,16 +20,16 @@ export interface RavenOptions {
serverName?: string;

/** List of messages to be fitlered out before being sent to Sentry. */
ignoreErrors?: string[];
ignoreErrors?: RegExp[] | string[];

/** Similar to ignoreErrors, but will ignore errors from whole urls patching a regex pattern. */
ignoreUrls?: RegExp[];
ignoreUrls?: RegExp[] | string[];
Copy link
Contributor

Choose a reason for hiding this comment

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

This still doesn't cover the case of:

ignoreUrls: [
  /foo/,
  'bar',
]

Does it?

Copy link
Contributor Author

@benvinegar benvinegar Jun 18, 2016

Choose a reason for hiding this comment

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

Ugh you're right, just tested it

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Fixed. We're learning TypeScript!

Copy link
Contributor

Choose a reason for hiding this comment

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

🙏


/** The inverse of ignoreUrls. Only report errors from whole urls matching a regex pattern. */
whitelistUrls?: RegExp[];
whitelistUrls?: RegExp[] | string[];

/** An array of regex patterns to indicate which urls are a part of your app. */
includePaths?: RegExp[];
includePaths?: RegExp[] | string[];

/** Additional data to be tagged onto the error. */
tags?: {
Expand Down