Updated test

This commit is contained in:
delvedor
2019-04-24 10:55:14 +02:00
parent e3a0e9ed56
commit 928746d19f
2 changed files with 5 additions and 18 deletions

View File

@ -38,7 +38,6 @@ test('Basic (callback)', t => {
client.search({
index: 'test',
type: 'doc',
q: 'foo:bar'
}, (err, { body }) => {
t.error(err)
@ -64,7 +63,6 @@ test('Basic (promises)', t => {
client
.search({
index: 'test',
type: 'doc',
q: 'foo:bar'
})
.then(({ body }) => {
@ -91,7 +89,6 @@ test('Error (callback)', t => {
client.search({
index: 'test',
type: 'doc',
q: 'foo:bar'
}, (err, { body }) => {
t.ok(err)
@ -117,7 +114,6 @@ test('Error (promises)', t => {
client
.search({
index: 'test',
type: 'doc',
q: 'foo:bar'
})
.then(t.fail)
@ -143,7 +139,6 @@ test('Abort method (callback)', t => {
const request = client.search({
index: 'test',
type: 'doc',
q: 'foo:bar'
}, (err, { body }) => {
t.error(err)
@ -170,7 +165,6 @@ test('Abort is not supported in promises', t => {
const request = client.search({
index: 'test',
type: 'doc',
q: 'foo:bar'
})
@ -200,7 +194,6 @@ test('Basic (options and callback)', t => {
client.search({
index: 'test',
type: 'doc',
q: 'foo:bar'
}, {
requestTimeout: 10000
@ -228,7 +221,6 @@ test('Basic (options and promises)', t => {
client
.search({
index: 'test',
type: 'doc',
q: 'foo:bar'
}, {
requestTimeout: 10000
@ -245,7 +237,7 @@ test('Pass unknown parameters as query parameters (and get a warning)', t => {
t.plan(4)
function handler (req, res) {
t.strictEqual(req.url, '/test/doc/_search?q=foo%3Abar&winter=is%20coming')
t.strictEqual(req.url, '/test/_search?q=foo%3Abar&winter=is%20coming')
res.setHeader('Content-Type', 'application/json;utf=8')
res.end(JSON.stringify({ hello: 'world' }))
}
@ -257,7 +249,6 @@ test('Pass unknown parameters as query parameters (and get a warning)', t => {
client.search({
index: 'test',
type: 'doc',
q: 'foo:bar',
winter: 'is coming'
}, (err, { body, warnings }) => {
@ -273,7 +264,7 @@ test('If the API uses the same key for both url and query parameter, the url sho
t.plan(2)
function handler (req, res) {
t.strictEqual(req.url, '/index/type/_bulk')
t.strictEqual(req.url, '/index/_bulk')
res.setHeader('Content-Type', 'application/json;utf=8')
res.end(JSON.stringify({ hello: 'world' }))
}
@ -286,7 +277,6 @@ test('If the API uses the same key for both url and query parameter, the url sho
// bulk has two `type` parameters
client.bulk({
index: 'index',
type: 'type',
body: []
}, (err, { body, warnings }) => {
t.error(err)

View File

@ -43,7 +43,7 @@ test('Should emit a request event when a request is performed', t => {
request: {
params: {
method: 'GET',
path: '/test/doc/_search',
path: '/test/_search',
body: '',
querystring: 'q=foo%3Abar',
headers: {
@ -72,7 +72,6 @@ test('Should emit a request event when a request is performed', t => {
client.search({
index: 'test',
type: 'doc',
q: 'foo:bar'
}, (err, result) => {
t.error(err)
@ -101,7 +100,7 @@ test('Should emit a response event in case of a successful response', t => {
request: {
params: {
method: 'GET',
path: '/test/doc/_search',
path: '/test/_search',
body: '',
querystring: 'q=foo%3Abar',
headers: {
@ -130,7 +129,6 @@ test('Should emit a response event in case of a successful response', t => {
client.search({
index: 'test',
type: 'doc',
q: 'foo:bar'
}, (err, result) => {
t.error(err)
@ -157,7 +155,7 @@ test('Should emit a response event with the error set', t => {
request: {
params: {
method: 'GET',
path: '/test/doc/_search',
path: '/test/_search',
body: '',
querystring: 'q=foo%3Abar',
headers: {
@ -186,7 +184,6 @@ test('Should emit a response event with the error set', t => {
client.search({
index: 'test',
type: 'doc',
q: 'foo:bar'
}, {
requestTimeout: 500