var nfieldCli = require('../index.js').NfieldClient;
var nock = require('nock');

var nfieldSifnIn = nock('https://api.nfieldmr.com/').post('/v1/SignIn').reply(200, { AuthenticationToken : 'mocked token' });

nfieldCli.connect(function (err, res) {
    if (err) console.log(err);
});//.then(console.log).catch(console.log)
@@ -78,27 +78,470 @@
 ');%0A
-%0Avar nfieldSifnIn =
+var expect = require('chai').expect;%0A%0Avar token = %7B AuthenticationToken : 'mocked token' %7D;%0A%0Avar credentials;%0A%0Adescribe('NfieldClient', function () %7B%0A  %0A  it('should have two methods: %5C'connect%5C' and %5C'defaults%5C'', function () %7B%0A    expect(nfieldCli).to.have.all.keys('defaults', 'connect');%0A  %7D);%0A  %0A  describe('defaults', function () %7B%0A    %0A    before(function () %7B%0A      credentials = %7B Domain : 'Domain', Username : 'Username', Password : 'Password' %7D;%0A     
  noc
@@ -559,15 +559,26 @@
 api.
+another
 nfield
-m
+serve
 r.co
@@ -616,161 +616,1771 @@
 00, 
-%7B AuthenticationToken : 'mocked token' %7D);%0A%0AnfieldCli.connect(function (err, res) %7B%0A    if (err) console.log(err);%0A%7D);//.then(console.log).catch(console.log)
+token);%0A    %7D);%0A    %0A    after(function () %7B%0A      nock.cleanAll();%0A    %7D);%0A    %0A    it('should return a new instance of %5C'NfieldClient%5C' with updated default request options', function (done) %7B%0A      var newCli = nfieldCli.defaults(%7B baseUrl : 'https://api.anothernfieldserver.com/' %7D);%0A      %0A      expect(newCli).to.have.all.keys('defaults', 'connect');%0A      %0A      newCli.connect(credentials).then(function (result) %7B%0A        expect(result).to.contain.all.keys('__TOKEN', '__REQUEST_OPTIONS', '__CREDENTIALS');%0A        done();%0A      %7D).catch(done);%0A    %7D);%0A    %0A    it('should throw a TypeError if called without options', function(done) %7B%0A      expect(nfieldCli.defaults).to.throw(TypeError);%0A      done();%0A    %7D);%0A    %0A  %7D);%0A  %0A  describe('connect', function() %7B%0A    %0A    beforeEach(function () %7B%0A      credentials = %7B Domain : 'Domain', Username : 'Username', Password : 'Password' %7D;%0A      nock('https://api.nfieldmr.com/').post('/v1/SignIn').reply(200, token);%0A    %7D);%0A    %0A    afterEach(function () %7B%0A      nock.cleanAll();%0A    %7D);%0A    %0A    it('should return a %5C'ConnectedInstance%5C' after connectiong to api with proper login information', function (done) %7B%0A      nfieldCli.connect(credentials).then(function (result) %7B%0A        expect(result).to.contain.all.keys('__TOKEN', '__REQUEST_OPTIONS', '__CREDENTIALS');%0A        done();%0A      %7D).catch(done);%0A    %7D);%0A    %0A    it('should return a %5C'RequiredError%5C' if not all required parameters provided during connection', function (done) %7B%0A      %0A      delete credentials.Domain;%0A      %0A      nfieldCli.connect(credentials).then(done).catch(function (error) %7B%0A        expect(error).to.have.property('name');%0A        expect(error.name).to.equal('RequiredError');%0A        done();%0A      %7D);%0A    %7D);%0A  %0A  %7D);%0A  %0A%7D);%0A

Add tests for NfieldClient and its methods