-
Notifications
You must be signed in to change notification settings - Fork 251
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
refactor: Tweaks based on PR feedback
- disambiguate event/payload sendEvent argument in tests - fix grammar - fix overzealous find and replaces
- Loading branch information
1 parent
cba9d08
commit 9b1873f
Showing
16 changed files
with
88 additions
and
88 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -23,10 +23,10 @@ describe('plugin: contextualize', () => { | |
it('should call the onUnhandledException callback when an error is captured', done => { | ||
const c = new Client(VALID_NOTIFIER) | ||
c.delivery(client => ({ | ||
sendEvent: (event, cb) => { | ||
expect(event.events[0].errorMessage).toBe('no item available') | ||
expect(event.events[0].severity).toBe('warning') | ||
expect(event.events[0].user).toEqual({ | ||
sendEvent: (payload, cb) => { | ||
expect(payload.events[0].errorMessage).toBe('no item available') | ||
expect(payload.events[0].severity).toBe('warning') | ||
expect(payload.events[0].user).toEqual({ | ||
id: '1a2c3cd4', | ||
name: 'Ben Gourley', | ||
email: '[email protected]' | ||
|
@@ -69,9 +69,9 @@ describe('plugin: contextualize', () => { | |
it('should add a stacktrace when missing', done => { | ||
const c = new Client(VALID_NOTIFIER) | ||
c.delivery(client => ({ | ||
sendEvent: (event, cb) => { | ||
expect(event.events[0].errorMessage).toBe('ENOENT: no such file or directory, open \'does not exist\'') | ||
expect(event.events[0].stacktrace[0].file).toBe(`${__filename}`) | ||
sendEvent: (payload, cb) => { | ||
expect(payload.events[0].errorMessage).toBe('ENOENT: no such file or directory, open \'does not exist\'') | ||
expect(payload.events[0].stacktrace[0].file).toBe(`${__filename}`) | ||
cb(null) | ||
}, | ||
sendSession: () => {} | ||
|
@@ -100,7 +100,7 @@ describe('plugin: contextualize', () => { | |
it('should tolerate a failed event', done => { | ||
const c = new Client(VALID_NOTIFIER) | ||
c.delivery(client => ({ | ||
sendEvent: (event, cb) => { | ||
sendEvent: (payload, cb) => { | ||
cb(new Error('sending failed')) | ||
}, | ||
sendSession: () => {} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.