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:
archana
2018-03-13 23:03:06 -05:00
committed by Spencer
parent 263bec4e03
commit 24e5e0f9f9
12 changed files with 9293 additions and 81 deletions

View File

@ -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() }
]

View File

@ -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);

View File

@ -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);

View File

@ -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);
});
});