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

@ -3648,8 +3648,6 @@ Options:::
<<api-param-type-number,`Number`>> -- The number of segments the index should be merged into (default: dynamic)
`onlyExpungeDeletes`::
<<api-param-type-boolean,`Boolean`>> -- Specify whether the operation should only expunge deleted documents
`waitForMerge`::
<<api-param-type-boolean,`Boolean`>> -- Specify whether the request should block until the merge process is finished (default: true)
`index`::
<<api-param-type-string,`String`>>, <<api-param-type-string-array,`String[]`>>, <<api-param-type-boolean,`Boolean`>> -- A comma-separated list of index names; use `_all` or empty string to perform the operation on all indices
`body`::

9264
package-lock.json generated Normal file

File diff suppressed because it is too large Load Diff

View File

@ -46,10 +46,12 @@
},
"devDependencies": {
"@spalger/eslint-config-personal": "^0.4.0",
"aliasify": "^2.1.0",
"async": "~0.8.0",
"babel-eslint": "^6.0.4",
"blanket": "^1.2.3",
"bluebird": "^2.9.14",
"browserify": "^16.1.1",
"eslint": "^2.9.0",
"eslint-config-airbnb": "^8.0.0",
"eslint-plugin-import": "^1.6.1",
@ -75,7 +77,7 @@
"grunt-run": "^0.6.0",
"grunt-saucelabs": "^8.6.2",
"grunt-webpack": "^1.0.11",
"jquery": "^2.2.3",
"jquery": "^3.3.1",
"js-yaml": "^3.6.0",
"load-grunt-config": "^0.19.2",
"load-grunt-tasks": "^3.5.0",

View File

@ -3332,7 +3332,6 @@ api.indices.prototype.flushSynced = ca({
* @param {<<api-param-type-string,`String`>>} [params.expandWildcards=open] - Whether to expand wildcard expression to concrete indices that are open, closed or both.
* @param {<<api-param-type-number,`Number`>>} params.maxNumSegments - The number of segments the index should be merged into (default: dynamic)
* @param {<<api-param-type-boolean,`Boolean`>>} params.onlyExpungeDeletes - Specify whether the operation should only expunge deleted documents
* @param {<<api-param-type-boolean,`Boolean`>>} params.waitForMerge - Specify whether the request should block until the merge process is finished (default: true)
* @param {<<api-param-type-string,`String`>>, <<api-param-type-string-array,`String[]`>>, <<api-param-type-boolean,`Boolean`>>} params.index - A comma-separated list of index names; use `_all` or empty string to perform the operation on all indices
*/
api.indices.prototype.forcemerge = ca({
@ -3366,10 +3365,6 @@ api.indices.prototype.forcemerge = ca({
onlyExpungeDeletes: {
type: 'boolean',
name: 'only_expunge_deletes'
},
waitForMerge: {
type: 'boolean',
name: 'wait_for_merge'
}
},
urls: [

View File

@ -3327,7 +3327,6 @@ api.indices.prototype.flushSynced = ca({
* @param {<<api-param-type-string,`String`>>} [params.expandWildcards=open] - Whether to expand wildcard expression to concrete indices that are open, closed or both.
* @param {<<api-param-type-number,`Number`>>} params.maxNumSegments - The number of segments the index should be merged into (default: dynamic)
* @param {<<api-param-type-boolean,`Boolean`>>} params.onlyExpungeDeletes - Specify whether the operation should only expunge deleted documents
* @param {<<api-param-type-boolean,`Boolean`>>} params.waitForMerge - Specify whether the request should block until the merge process is finished (default: true)
* @param {<<api-param-type-string,`String`>>, <<api-param-type-string-array,`String[]`>>, <<api-param-type-boolean,`Boolean`>>} params.index - A comma-separated list of index names; use `_all` or empty string to perform the operation on all indices
*/
api.indices.prototype.forcemerge = ca({
@ -3361,10 +3360,6 @@ api.indices.prototype.forcemerge = ca({
onlyExpungeDeletes: {
type: 'boolean',
name: 'only_expunge_deletes'
},
waitForMerge: {
type: 'boolean',
name: 'wait_for_merge'
}
},
urls: [

View File

@ -3322,7 +3322,6 @@ api.indices.prototype.flushSynced = ca({
* @param {<<api-param-type-string,`String`>>} [params.expandWildcards=open] - Whether to expand wildcard expression to concrete indices that are open, closed or both.
* @param {<<api-param-type-number,`Number`>>} params.maxNumSegments - The number of segments the index should be merged into (default: dynamic)
* @param {<<api-param-type-boolean,`Boolean`>>} params.onlyExpungeDeletes - Specify whether the operation should only expunge deleted documents
* @param {<<api-param-type-boolean,`Boolean`>>} params.waitForMerge - Specify whether the request should block until the merge process is finished (default: true)
* @param {<<api-param-type-string,`String`>>, <<api-param-type-string-array,`String[]`>>, <<api-param-type-boolean,`Boolean`>>} params.index - A comma-separated list of index names; use `_all` or empty string to perform the operation on all indices
*/
api.indices.prototype.forcemerge = ca({
@ -3356,10 +3355,6 @@ api.indices.prototype.forcemerge = ca({
onlyExpungeDeletes: {
type: 'boolean',
name: 'only_expunge_deletes'
},
waitForMerge: {
type: 'boolean',
name: 'wait_for_merge'
}
},
urls: [

View File

@ -52,31 +52,16 @@ _.deepMerge = function (to, from) {
};
/**
* Test if a value is an array and it's contents are of a specific type
* Test if a value is an array and its contents are string type
*
* @method isArrayOf<Strings|Object|Array|Finite|Function|RegExp>s
* @method isArrayOfStrings
* @param {Array} arr - An array to check
* @return {Boolean}
*/
_.each([
'String',
'Object',
'PlainObject',
'Array',
'Finite',
'Function',
'RegExp'
], function (type) {
var check = _['is' + type];
_['isArrayOf' + type + 's'] = function (arr) {
// quick shallow check of arrays
return _.isArray(arr) && _.every(arr.slice(0, 10), function (item) {
return check(item);
});
};
});
_.isArrayOfStrings = function (arr) {
// quick shallow check of arrays
return _.isArray(arr) && _.every(arr.slice(0, 10), _.isString);
};
/**

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

View File

@ -61,11 +61,11 @@ function bundleTests(name) {
res.set('Content-Type', 'application/javascript');
var b = browserify(testFiles[name]);
b.transform(aliasify);
var str = b.bundle({
var b = browserify(testFiles[name], {
insertGlobals: true
});
b.transform(aliasify);
var str = b.bundle();
str.pipe(res);
str.once('end', done);
@ -90,7 +90,7 @@ app
.get('/builds.html', sendFile(root + '/test/browser_build_unit_tests.html'))
// support
.get('/expect.js', sendFile(root + '/node_modules/expect.js/expect.js'))
.get('/expect.js', sendFile(root + '/node_modules/expect.js/index.js'))
.get('/mocha.css', sendFile(root + '/node_modules/mocha/mocha.css'))
.get('/mocha.js', sendFile(root + '/node_modules/mocha/mocha.js'))
.get('/screencast-reporter.css', sendFile(root + '/node_modules/mocha-screencast-reporter/screencast-reporter.css'))