change test structure, create elasticsearch fixture
This commit is contained in:
@@ -4,7 +4,7 @@
|
|||||||
"description": "",
|
"description": "",
|
||||||
"main": "lib/index.js",
|
"main": "lib/index.js",
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"test": "npm run build && mocha --compilers js:babel-core/register test/**",
|
"test": "npm run build && mocha --compilers js:babel-core/register test/src/**",
|
||||||
"build": "babel src --out-dir lib",
|
"build": "babel src --out-dir lib",
|
||||||
"prepublish": "npm run test"
|
"prepublish": "npm run test"
|
||||||
},
|
},
|
||||||
|
|||||||
6
test/fixtures/elasticsearch.js
vendored
Normal file
6
test/fixtures/elasticsearch.js
vendored
Normal file
@@ -0,0 +1,6 @@
|
|||||||
|
function Client() {}
|
||||||
|
Client.prototype.index = function () {};
|
||||||
|
|
||||||
|
export default {
|
||||||
|
Client: Client
|
||||||
|
};
|
||||||
@@ -1,11 +1,8 @@
|
|||||||
import expect from 'expect.js';
|
import expect from 'expect.js';
|
||||||
import proxyquire from 'proxyquire';
|
import proxyquire from 'proxyquire';
|
||||||
|
import * as elasticsearchMock from '../../fixtures/elasticsearch';
|
||||||
|
|
||||||
const elasticsearchMock = {
|
const createClient = proxyquire.noPreserveCache()('../../../lib/helpers/create_client', {
|
||||||
Client: function Client() {}
|
|
||||||
};
|
|
||||||
|
|
||||||
const createClient = proxyquire.noPreserveCache()('../../lib/helpers/create_client', {
|
|
||||||
elasticsearch: elasticsearchMock
|
elasticsearch: elasticsearchMock
|
||||||
});
|
});
|
||||||
|
|
||||||
@@ -1,4 +1,4 @@
|
|||||||
import Elastique from '../lib/index';
|
import Elastique from '../../lib/index';
|
||||||
import expect from 'expect.js';
|
import expect from 'expect.js';
|
||||||
|
|
||||||
describe('Elastique class', function () {
|
describe('Elastique class', function () {
|
||||||
@@ -24,4 +24,9 @@ describe('Elastique class', function () {
|
|||||||
expect(init).to.throwException(/invalid.+protocol/i);
|
expect(init).to.throwException(/invalid.+protocol/i);
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
|
describe('Job Creation', function () {
|
||||||
|
|
||||||
|
});
|
||||||
|
|
||||||
});
|
});
|
||||||
Reference in New Issue
Block a user