{"size": 1889, "ext": "js", "max_stars_repo_path": "net/__tests__/axios.tests.js", "max_stars_repo_name": "tryggvigy/MojiScript", "max_stars_repo_stars_event_min_datetime": "2018-09-12T22:44:38.000Z", "max_stars_repo_stars_event_max_datetime": "2021-11-16T01:23:36.000Z", "max_issues_repo_path": "net/__tests__/axios.tests.js", "max_issues_repo_name": "tryggvigy/MojiScript", "max_issues_repo_issues_event_min_datetime": "2018-09-25T05:45:05.000Z", "max_issues_repo_issues_event_max_datetime": "2022-02-27T21:23:45.000Z", "max_forks_repo_path": "net/__tests__/axios.tests.js", "max_forks_repo_name": "tryggvigy/MojiScript", "max_forks_repo_forks_event_min_datetime": "2018-10-09T23:42:19.000Z", "max_forks_repo_forks_event_max_datetime": "2020-05-06T16:12:24.000Z"}
{"max_stars_count": 145, "max_issues_count": 168, "max_forks_count": 33, "avg_line_length": 27.7794117647, "max_line_length": 67, "alphanum_fraction": 0.5992588671}
const actualAxios = require('axios')
const axios = require('../axios')

describe('net/axios', () => {
  beforeEach(() => {
    jest.spyOn(actualAxios, 'get').mockImplementation(() => {})
    jest.spyOn(actualAxios, 'delete').mockImplementation(() => {})
    jest.spyOn(actualAxios, 'head').mockImplementation(() => {})
    jest.spyOn(actualAxios, 'options').mockImplementation(() => {})
    jest.spyOn(actualAxios, 'post').mockImplementation(() => {})
    jest.spyOn(actualAxios, 'put').mockImplementation(() => {})
    jest.spyOn(actualAxios, 'patch').mockImplementation(() => {})
  })

  afterEach(() => {
    jest.clearAllMocks()
  })

  test('get', () => {
    const expected = [ [ 1, 2 ] ]
    axios.get(1)(2)
    const actual = actualAxios.get.mock.calls
    expect(actual).toMatchObject(expected)
  })

  test('delete', () => {
    const expected = [ [ 1, 2 ] ]
    axios.delete(1)(2)
    const actual = actualAxios.delete.mock.calls
    expect(actual).toMatchObject(expected)
  })

  test('head', () => {
    const expected = [ [ 1, 2 ] ]
    axios.head(1)(2)
    const actual = actualAxios.head.mock.calls
    expect(actual).toMatchObject(expected)
  })

  test('options', () => {
    const expected = [ [ 1, 2 ] ]
    axios.options(1)(2)
    const actual = actualAxios.options.mock.calls
    expect(actual).toMatchObject(expected)
  })

  test('post', () => {
    const expected = [ [ 1, 2, 3 ] ]
    axios.post(1)(2)(3)
    const actual = actualAxios.post.mock.calls
    expect(actual).toMatchObject(expected)
  })

  test('put', () => {
    const expected = [ [ 1, 2, 3 ] ]
    axios.put(1)(2)(3)
    const actual = actualAxios.put.mock.calls
    expect(actual).toMatchObject(expected)
  })

  test('patch', () => {
    const expected = [ [ 1, 2, 3 ] ]
    axios.patch(1)(2)(3)
    const actual = actualAxios.patch.mock.calls
    expect(actual).toMatchObject(expected)
  })
})
