<commit_before>const auth = require('../lib/auth');
const sites = require('../lib/sites');
const request = require('superagent');
const config = require('../mock/superagent-mock');
var superagent = require('superagent-mock')(request, config);

describe('sites.get()', () => {
  it('returns all available account sites if no arguments provided', () => {
    var authPath = 'https://api-auth-eu.maxymiser.com';
    var basePath = 'https://api-eu.maxymiser.com/v1';
    var credentials = {
      clientId: 'clientId',
      clientSecret: 'clientSecret',
      username: 'username',
      password: 'password'
    };
    var authorize = auth.authorize(token, authPath, credentials);
    var s = sites(basePath, authorize);
    var expectedResult = [{
      id: 'MzIxMzM',
      name: 'www.test.com'
    }, {
      id: 'MzIxMzI=',
      name: 'm.test.com'
    }];
    var token;

    return s.get()
      .then(sites => {
        expect(sites).toEqual(expectedResult);
      })
  });
});<commit_msg>~ sites-test with new tests<commit_after>const auth = require('../lib/auth');
const sites = require('../lib/sites');
const request = require('superagent');
const config = require('../mock/superagent-mock');
var superagent = require('superagent-mock')(request, config);

var authPath = 'https://api-auth-eu.maxymiser.com';
var basePath = 'https://api-eu.maxymiser.com/v1';
var credentials = {
  clientId: 'clientId',
  clientSecret: 'clientSecret',
  username: 'username',
  password: 'password'
};
var token;

describe('sites.get()', () => {
  it('returns all available account sites if no arguments provided', () => {
    var authorize = auth.authorize(token, authPath, credentials);
    var s = sites(basePath, authorize);
    var expectedResult = [
      { id: 'MzIxMzM', name: 'www.test.com' },
      { id: 'MzIxMzI=', name: 'm.test.com' }
    ];

    return s.get()
      .then(sites => {
        expect(sites).toEqual(expectedResult);
      })
  });

  it('returns site by ID', () => {
    var authorize = auth.authorize(token, authPath, credentials);
    var s = sites(basePath, authorize);
    var expectedResult = {
      id: 'MzIxMzM',
      name: 'www.test.com',
      lastIterationPublishDate: '2017-02-13T10:32:28.0000000Z',
      lastIterationPublishHash: 'LgK4w_RWUHeClDakSoE7tvjZk_M'
    };

    return s.get({siteId: 'MzIxMzM'})
      .then(site => {
        expect(site).toEqual(expectedResult);
      })
  });

  it('returns site by name', () => {
    var authorize = auth.authorize(token, authPath, credentials);
    var s = sites(basePath, authorize);
    var expectedResult = {
      id: 'MzIxMzM',
      name: 'www.test.com'
    };

    return s.get({siteName: 'www.test.com'})
      .then(site => {
        expect(site).toEqual(expectedResult);
      })
  });
});

// describe('sites.scripts.get()', () => {
//   it('returns all site scripts', () => {

//   });
// });
{'fraction_non_alphanumeric': 0.17983367983367984, 'fraction_numerical': 0.008662508662508662, 'mean_word_length': 3.0950354609929076, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 15, 'https://': 4, 'lorem ipsum': 0, 'www.': 5, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 1, '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': '2813594', 'n_tokens_mistral': 996, 'n_tokens_neox': 960, 'n_words': 195}