<commit_before>/**
 * WPCONN module
 */

var WPCONN = require('../');

/**
 * Testing data
 */

var tdata = require('./data');
var util = require('./util');

/**
 * WPCONN object
 */

describe('WPCONN', function(){
  it('should create a WPCONN object', function(){
    var wpconn = new WPCONN();
    wpconn.should.be.instanceof(WPCONN);
  });

  it('should set the token', function(){
    var wpconn = new WPCONN();
    var token = tdata.token;
    wpconn.setToken(token);

    wpconn.opts.token
      .should.be.ok
      .and.be.instanceOf(String)
      .eql(token);
  });
});

/**
 * ME
 */

describe('me', function(){
  it('should require user object', function(done){
    var wpconn = util.wpconn();

    wpconn.me(function(err, me){
      if (err) throw err;

      // testing object
      me
        .should.be.ok
        .and.an.instanceOf(Object);

      // testing user data
      me.ID
        .should.be.an.instanceOf(Number);

      done();
    });
  });<commit_msg>test: update getting token value<commit_after>/**
 * WPCONN module
 */

var WPCONN = require('../');

/**
 * Testing data
 */

var tdata = require('./data');
var util = require('./util');

/**
 * WPCONN object
 */

describe('WPCONN', function(){
  it('should create a WPCONN object', function(){
    var wpconn = new WPCONN();
    wpconn.should.be.instanceof(WPCONN);
  });

  it('should set the token', function(){
    var wpconn = new WPCONN();
    var token = tdata.token;
    wpconn.setToken(token);

    wpconn.token
      .should.be.ok
      .and.be.instanceOf(String)
      .eql(token);
  });
});

/**
 * ME
 */

describe('me', function(){
  it('should require user object', function(done){
    var wpconn = util.wpconn();

    wpconn.me(function(err, me){
      if (err) throw err;

      // testing object
      me
        .should.be.ok
        .and.an.instanceOf(Object);

      // testing user data
      me.ID
        .should.be.an.instanceOf(Number);

      done();
    });
  });
{'fraction_non_alphanumeric': 0.17766497461928935, 'fraction_numerical': 0.0, 'mean_word_length': 2.363481228668942, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, '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': '6835274', 'n_tokens_mistral': 678, 'n_tokens_neox': 675, 'n_words': 152}