Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

elastictest

Package Overview
Dependencies
Maintainers
1
Versions
7
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

elastictest - npm Package Compare versions

Comparing version 2.0.0 to 3.0.0

33

lib/Suite.js
var randomstring = require('randomstring'),
elasticsearch = require('elasticsearch'),
async = require('async');
const _ = require('lodash');
const randomstring = require('randomstring');
const elasticsearch = require('elasticsearch');
const async = require('async');

@@ -15,3 +16,3 @@ function Suite( clientOpts, props ){

this.props = props || {};
if( !this.props.hasOwnProperty('index') ){
if( !_.has(this, 'props.index') ){
this.props.index = 'testindex-' + randomstring.generate(7).toLowerCase();

@@ -35,4 +36,4 @@ }

Suite.prototype.create = function( cb ){
var cmd = { index: this.props.index };
if( this.props.hasOwnProperty('schema') ){
var cmd = _.merge(this.props.create, { index: this.props.index });
if( _.has(this, 'props.schema') ){
cmd.body = this.props.schema;

@@ -44,3 +45,3 @@ }

Suite.prototype.delete = function( cb ){
var cmd = { index: this.props.index };
var cmd = _.merge(this.props.delete, { index: this.props.index });
this.client.indices.delete( cmd, cb );

@@ -50,3 +51,3 @@ };

Suite.prototype.refresh = function( cb ){
var cmd = { index: this.props.index };
var cmd = _.merge(this.props.refresh, { index: this.props.index });
this.client.indices.refresh( cmd, cb );

@@ -73,18 +74,18 @@ };

var self = this;
self.start( function( err ){
self.start( err => {
if( err ){ throw new Error( err ); }
self.waitForStatus( 'yellow', function( err ){
self.waitForStatus( 'yellow', err => {
if( err ){ throw new Error( err ); }
self.create( function( err ){
self.create( err => {
if( err ){ throw new Error( err ); }
async.series( self.actions, function( err ){
async.series( self.actions, err => {
if( err ){ throw new Error( err ); }
self.refresh( function( err ){
self.refresh( err => {
if( err ){ throw new Error( err ); }
self.optimize( async.series( self.asserts, function( err ){
self.optimize( async.series( self.asserts, err => {
if( err ){ throw new Error( err ); }
self.delete( function( err ){
self.delete( err => {
if( err ){ throw new Error( err ); }
self.client.close();
if( 'function' === typeof cb ){
if( _.isFunction( cb ) ){
cb();

@@ -91,0 +92,0 @@ }

{
"name": "elastictest",
"version": "2.0.0",
"version": "3.0.0",
"description": "A simple test harness for elasticsearch functional testing",

@@ -29,6 +29,7 @@ "main": "index.js",

"dependencies": {
"async": "^2.6.1",
"elasticsearch": "^15.1.1",
"async": "^3.1.0",
"elasticsearch": "^16.5.0",
"lodash": "^4.17.15",
"randomstring": "^1.1.5"
}
}

@@ -8,3 +8,3 @@

settings: { index: { refresh_interval: '-1' } },
mappings: { mytype: { properties: { name: { type: 'long' } } } }
mappings: { _doc: { properties: { name: { type: 'long' } } } }
};

@@ -23,3 +23,3 @@

index: suite.props.index,
type: 'mytype'
type: '_doc'
}, function( err, res ){

@@ -26,0 +26,0 @@ t.deepEqual( res[suite.props.index].mappings, custom_schema.mappings, 'mappings set' );

@@ -14,3 +14,3 @@

index: suite.props.index,
type: 'mytype',
type: '_doc',
id: '1',

@@ -17,0 +17,0 @@ body: {

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc