mirror of
https://github.com/cypress-io/cypress.git
synced 2026-05-04 05:50:47 -05:00
export what is called directly to avoid circular ref proxy that's unstubbable
This commit is contained in:
@@ -1,12 +1,12 @@
|
||||
import errors from '@packages/errors'
|
||||
import Bluebird from 'bluebird'
|
||||
import errors from '@packages/errors'
|
||||
import exception from './exception'
|
||||
|
||||
const isProduction = () => {
|
||||
return process.env['CYPRESS_INTERNAL_ENV'] === 'production'
|
||||
}
|
||||
|
||||
const logException = Bluebird.method(function (this: any, err) {
|
||||
export const logException = Bluebird.method(function (this: any, err) {
|
||||
// TODO: remove context here
|
||||
if (this.log(err) && isProduction()) {
|
||||
// log this exception since
|
||||
@@ -17,9 +17,4 @@ const logException = Bluebird.method(function (this: any, err) {
|
||||
}
|
||||
})
|
||||
|
||||
const errorApi = {
|
||||
...errors,
|
||||
logException,
|
||||
}
|
||||
|
||||
export = errorApi
|
||||
export const warning = errors.warning
|
||||
|
||||
@@ -919,7 +919,6 @@ describe('lib/api', () => {
|
||||
|
||||
return api.retryWithBackoff(fn)
|
||||
.then(() => {
|
||||
console.log('gsd')
|
||||
expect(fn).to.be.calledTwice
|
||||
expect(fn.firstCall.args[0]).eq(0)
|
||||
expect(fn.secondCall.args[0]).eq(1)
|
||||
|
||||
Reference in New Issue
Block a user