<commit_before>import sinon from 'sinon'
import authenticateWrapper from '../src/authenticate_wrapper'

describe('method "fail"', () => {
  test('should works correctly with Error', () => {
    const context = {
      jwtCookie: {
        name: 'jwt'
      },
      internalRes: {
        clearCookie: sinon.stub(),
        redirect: sinon.stub(),
        resolveAuth: sinon.stub()
      },
      originalOptions: {},
      resolveAuth: sinon.stub()
    }
    const error = new Error('test')
    const status = undefined<commit_msg>Silence!<commit_after>import sinon from 'sinon'
import authenticateWrapper from '../src/authenticate_wrapper'

describe('method "fail"', () => {
  /* eslint-disable no-console */
  const consoleError = console.error
  beforeAll(() => {
    console.error = jest.fn()
  })
  afterAll(() => {
    console.error = consoleError.bind(console)
  })
  /* eslint-enable no-console */

  test('should works correctly with Error', () => {
    const context = {
      jwtCookie: {
        name: 'jwt'
      },
      internalRes: {
        clearCookie: sinon.stub(),
        redirect: sinon.stub(),
        resolveAuth: sinon.stub()
      },
      originalOptions: {},
      resolveAuth: sinon.stub()
    }
    const error = new Error('test')
    const status = undefined
{'fraction_non_alphanumeric': 0.1449612403100775, 'fraction_numerical': 0.0, 'mean_word_length': 2.61624649859944, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 9, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '140175', 'n_tokens_mistral': 388, 'n_tokens_neox': 388, 'n_words': 86}