export what is called directly to avoid circular ref proxy that's unstubbable

This commit is contained in:
Brian Mann
2022-02-14 20:49:35 -05:00
parent 81a0b0f0d2
commit e53e74f1f3
2 changed files with 3 additions and 9 deletions
+3 -8
View File
@@ -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
-1
View File
@@ -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)