<commit_before>import MockAdapter from 'axios-mock-adapter';
import assert from 'assert';
import Chai from 'chai';
import Chatwork from '../index';

const chai = Chai.assert;

describe('/contactsのテスト', () => {
  it('GET /contacts', () => {
    const cw = new Chatwork('apiKey');
    const mock = new MockAdapter(cw.instance);

    const mockRes = [
      {
        account_id: 123,
        room_id: 322,
        name: '<NAME>',
        chatwork_id: 'tarochatworkid',
        organization_id: 101,
        organization_name: 'Hello Company',
        department: 'Marketing',
        avatar_image_url: 'https://example.com/abc.png',
      },
    ];

    mock.onGet('/contacts').reply(200, mockRes);

    return cw.listMyContacts().then(res => {
      assert(
        JSON.stringify(res.data) === JSON.stringify(mockRes),
      );
    })
    .catch(err => {
      chai.fail(0, 1, err.message);
    });
  });
});
<commit_msg>Modify expression of mocha in contacts.js<commit_after>import MockAdapter from 'axios-mock-adapter';
import assert from 'assert';
import Chai from 'chai';
import Chatwork from '../index';

const chai = Chai.assert;

describe('/contactsのテスト', () => {
  describe('GET', () => {
    it('/contacts', () => {
      const cw = new Chatwork('apiKey');
      const mock = new MockAdapter(cw.instance);

      const mockRes = [
        {
          account_id: 123,
          room_id: 322,
          name: '<NAME>',
          chatwork_id: 'tarochatworkid',
          organization_id: 101,
          organization_name: 'Hello Company',
          department: 'Marketing',
          avatar_image_url: 'https://example.com/abc.png',
        },
      ];

      mock.onGet('/contacts').reply(200, mockRes);

      return cw.listMyContacts().then(res => {
        assert(
          JSON.stringify(res.data) === JSON.stringify(mockRes),
        );
      })
      .catch(err => {
        chai.fail(0, 1, err.message);
      });
    });
  });
});

{'fraction_non_alphanumeric': 0.16170431211498973, 'fraction_numerical': 0.014373716632443531, 'mean_word_length': 2.3778162911611784, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 14, 'https://': 2, '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': '3169741', 'n_tokens_mistral': 652, 'n_tokens_neox': 621, 'n_words': 125}