<commit_before><commit_msg>added unit tests for apiResponse file<commit_after>import ApiResponse from '../rest/apiResponse.js';

const response = new ApiResponse(200, { type: 'Fiat', model: '500', color: 'white' });

describe('apiResponse', () => {
  it('returns true when statuses are the same', () => {
    const status = 200;
    expect(response.hasStatus(status)).toEqual(true);
  });
  it('returns false when statuses are different', () => {
    const status = 100;
    expect(response.hasStatus(status)).toEqual(false);
  });
  it('returns true when response match given object', () => {
    const body = { type: 'Fiat', model: '500', color: 'white' };
    expect(response.hasBodyMatch(body)).toEqual(true);
  });
  it('returns false when response doesnt match given object', () => {
    const body = { model: '500', color: 'white' };
    expect(response.hasStatus(body)).toEqual(false);
  });
});

{'fraction_non_alphanumeric': 0.1747787610619469, 'fraction_numerical': 0.01991150442477876, 'mean_word_length': 4.419161676646707, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 8, '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': '6512585', 'n_tokens_mistral': 281, 'n_tokens_neox': 270, 'n_words': 72}