Skip to content
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

Remove console.info from EntityRequest error handler #210

Merged
Merged
Show file tree
Hide file tree
Changes from 13 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
Original file line number Diff line number Diff line change
Expand Up @@ -127,10 +127,6 @@ function resolveRequest (acc, resolveReducer) {
)
].join('')

// this is useful in the case the error itself is not logged by the
// implementation
console.info(redactedError.toString(), message)

// attaching to error so it can be exposed by a handler outside datapoint
error.message = `${error.message}\n\n${message}`
throw error
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -219,13 +219,6 @@ describe('getRequestOptions', () => {
})

describe('resolveRequest', () => {
let consoleInfo
beforeAll(() => {
consoleInfo = console.info
})
afterEach(() => {
console.info = consoleInfo
})
test('resolve reducer locals', () => {
nock('http://remote.test')
.get('/source1')
Expand Down Expand Up @@ -260,11 +253,9 @@ describe('resolveRequest', () => {
value: 'foo'
}
_.set(acc, 'reducer.spec.id', 'test:test')
console.info = jest.fn()
return Resolve.resolveRequest(acc)
.catch(e => e)
.then(result => {
expect(console.info).toBeCalled()
expect(result.message).toMatchSnapshot()
})
})
Expand Down Expand Up @@ -393,15 +384,13 @@ describe('resolve', () => {
})

test('it should omit options.auth when encountering an error', () => {
console.info = jest.fn()
nock('http://remote.test')
.get('/source1')
.reply(404)

return transform('request:a9', {}).catch(err => {
expect(err.statusCode).toEqual(404)
expect(err.message).toMatchSnapshot()
expect(console.info).toBeCalled()
Copy link
Contributor

Choose a reason for hiding this comment

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

we're using jest to mock console.info, so we can remove some of that code as well. please search the file for console.info and remove any code that you find if it's no longer being used.


// credentials are still available in the raw error.options
expect(err.options.auth).toEqual({
Expand Down