Bump jquery and update some tests (#644)
* Remove jquery from devDependencies, syntax * Add browserify and aliasify * Bump jquery * Bump jquery and make some tests pass
This commit is contained in:
@ -72,7 +72,7 @@ describe('Client instances creation', function () {
|
||||
done();
|
||||
};
|
||||
|
||||
var client = new es.Client({
|
||||
client = new es.Client({
|
||||
log: [
|
||||
{ type: 'stream', stream: new NullStream() }
|
||||
]
|
||||
|
||||
@ -444,7 +444,7 @@ describe('Http Connector', function () {
|
||||
var con = new HttpConnection(new Host());
|
||||
var respBody = 'i should not be encoded';
|
||||
var server = nock('http://localhost:9200')
|
||||
.matchHeader('accept-encoding', function (v) {
|
||||
.matchHeader('Accept-Encoding', function (v) {
|
||||
|
||||
return v === undefined;
|
||||
})
|
||||
@ -463,7 +463,7 @@ describe('Http Connector', function () {
|
||||
var con = new HttpConnection(new Host({ suggestCompression: true }));
|
||||
var respBody = 'i should be encoded';
|
||||
var server = nock('http://localhost:9200')
|
||||
.matchHeader('accept-encoding', 'gzip,deflate')
|
||||
.matchHeader('Accept-Encoding', 'gzip,deflate')
|
||||
.get('/')
|
||||
.once()
|
||||
.reply(200, respBody);
|
||||
|
||||
@ -100,7 +100,7 @@ describe('Log class', function () {
|
||||
expect(Log.join([{ foo: 'bar' }])).to.eql('{\n "foo": "bar"\n}\n');
|
||||
});
|
||||
|
||||
it('fully stringifies deeply nested objects', function() {
|
||||
it('fully stringifies deeply nested objects', function () {
|
||||
var object = { foo: { bar: { baz: 'value' } } };
|
||||
var expected = '{\n "bar": {\n "baz": "value"\n }\n}\n';
|
||||
expect(Log.join(object)).to.eql(expected);
|
||||
|
||||
@ -6,42 +6,20 @@ var stub = require('../../utils/auto_release_stub').make();
|
||||
describe('Utils', function () {
|
||||
|
||||
describe('Additional Type Checkers', function () {
|
||||
_.forEach({
|
||||
Object: {
|
||||
is: [[], /regexp/]
|
||||
},
|
||||
PlainObject: {
|
||||
is: [{}, {}]
|
||||
},
|
||||
String: {
|
||||
is: ['steamy', 'poop'],
|
||||
describe('#isArrayOfStrings', function () {
|
||||
const thing = {
|
||||
is: ['creamy', 'poop'],
|
||||
not: {}
|
||||
},
|
||||
Array: {
|
||||
is: [['im'], ['usefull']],
|
||||
},
|
||||
Finite: {
|
||||
is: [11123, 777],
|
||||
not: Infinity
|
||||
},
|
||||
Function: {
|
||||
is: [function () {}, function () {}],
|
||||
},
|
||||
RegExp: {
|
||||
is: [/.*/, new RegExp('a')],
|
||||
}
|
||||
},
|
||||
function (thing, name) {
|
||||
describe('#isArrayOf' + name, function () {
|
||||
it('likes arrays of ' + name, function () {
|
||||
expect(_['isArrayOf' + name + 's'](thing.is)).to.be(true);
|
||||
});
|
||||
};
|
||||
|
||||
it('dislikes when there is even one non ' + name, function () {
|
||||
// notice a string in the array
|
||||
thing.is.push(thing.not || ' not ');
|
||||
expect(_['isArrayOf' + name + 's'](thing.is)).to.be(false);
|
||||
});
|
||||
it('likes arrays of strings', function () {
|
||||
expect(_.isArrayOfStrings(thing.is)).to.be(true);
|
||||
});
|
||||
|
||||
it('dislikes when there is even one non string', function () {
|
||||
// notice a string in the array
|
||||
thing.is.push(thing.not || ' not ');
|
||||
expect(_.isArrayOfStrings(thing.is)).to.be(false);
|
||||
});
|
||||
});
|
||||
|
||||
|
||||
Reference in New Issue
Block a user