Skip to content

Commit 928746d

Browse files
committed
Updated test
1 parent e3a0e9e commit 928746d

File tree

2 files changed

+5
-18
lines changed

2 files changed

+5
-18
lines changed

test/unit/api.test.js

Lines changed: 2 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,6 @@ test('Basic (callback)', t => {
3838

3939
client.search({
4040
index: 'test',
41-
type: 'doc',
4241
q: 'foo:bar'
4342
}, (err, { body }) => {
4443
t.error(err)
@@ -64,7 +63,6 @@ test('Basic (promises)', t => {
6463
client
6564
.search({
6665
index: 'test',
67-
type: 'doc',
6866
q: 'foo:bar'
6967
})
7068
.then(({ body }) => {
@@ -91,7 +89,6 @@ test('Error (callback)', t => {
9189

9290
client.search({
9391
index: 'test',
94-
type: 'doc',
9592
q: 'foo:bar'
9693
}, (err, { body }) => {
9794
t.ok(err)
@@ -117,7 +114,6 @@ test('Error (promises)', t => {
117114
client
118115
.search({
119116
index: 'test',
120-
type: 'doc',
121117
q: 'foo:bar'
122118
})
123119
.then(t.fail)
@@ -143,7 +139,6 @@ test('Abort method (callback)', t => {
143139

144140
const request = client.search({
145141
index: 'test',
146-
type: 'doc',
147142
q: 'foo:bar'
148143
}, (err, { body }) => {
149144
t.error(err)
@@ -170,7 +165,6 @@ test('Abort is not supported in promises', t => {
170165

171166
const request = client.search({
172167
index: 'test',
173-
type: 'doc',
174168
q: 'foo:bar'
175169
})
176170

@@ -200,7 +194,6 @@ test('Basic (options and callback)', t => {
200194

201195
client.search({
202196
index: 'test',
203-
type: 'doc',
204197
q: 'foo:bar'
205198
}, {
206199
requestTimeout: 10000
@@ -228,7 +221,6 @@ test('Basic (options and promises)', t => {
228221
client
229222
.search({
230223
index: 'test',
231-
type: 'doc',
232224
q: 'foo:bar'
233225
}, {
234226
requestTimeout: 10000
@@ -245,7 +237,7 @@ test('Pass unknown parameters as query parameters (and get a warning)', t => {
245237
t.plan(4)
246238

247239
function handler (req, res) {
248-
t.strictEqual(req.url, '/test/doc/_search?q=foo%3Abar&winter=is%20coming')
240+
t.strictEqual(req.url, '/test/_search?q=foo%3Abar&winter=is%20coming')
249241
res.setHeader('Content-Type', 'application/json;utf=8')
250242
res.end(JSON.stringify({ hello: 'world' }))
251243
}
@@ -257,7 +249,6 @@ test('Pass unknown parameters as query parameters (and get a warning)', t => {
257249

258250
client.search({
259251
index: 'test',
260-
type: 'doc',
261252
q: 'foo:bar',
262253
winter: 'is coming'
263254
}, (err, { body, warnings }) => {
@@ -273,7 +264,7 @@ test('If the API uses the same key for both url and query parameter, the url sho
273264
t.plan(2)
274265

275266
function handler (req, res) {
276-
t.strictEqual(req.url, '/index/type/_bulk')
267+
t.strictEqual(req.url, '/index/_bulk')
277268
res.setHeader('Content-Type', 'application/json;utf=8')
278269
res.end(JSON.stringify({ hello: 'world' }))
279270
}
@@ -286,7 +277,6 @@ test('If the API uses the same key for both url and query parameter, the url sho
286277
// bulk has two `type` parameters
287278
client.bulk({
288279
index: 'index',
289-
type: 'type',
290280
body: []
291281
}, (err, { body, warnings }) => {
292282
t.error(err)

test/unit/events.test.js

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ test('Should emit a request event when a request is performed', t => {
4343
request: {
4444
params: {
4545
method: 'GET',
46-
path: '/test/doc/_search',
46+
path: '/test/_search',
4747
body: '',
4848
querystring: 'q=foo%3Abar',
4949
headers: {
@@ -72,7 +72,6 @@ test('Should emit a request event when a request is performed', t => {
7272

7373
client.search({
7474
index: 'test',
75-
type: 'doc',
7675
q: 'foo:bar'
7776
}, (err, result) => {
7877
t.error(err)
@@ -101,7 +100,7 @@ test('Should emit a response event in case of a successful response', t => {
101100
request: {
102101
params: {
103102
method: 'GET',
104-
path: '/test/doc/_search',
103+
path: '/test/_search',
105104
body: '',
106105
querystring: 'q=foo%3Abar',
107106
headers: {
@@ -130,7 +129,6 @@ test('Should emit a response event in case of a successful response', t => {
130129

131130
client.search({
132131
index: 'test',
133-
type: 'doc',
134132
q: 'foo:bar'
135133
}, (err, result) => {
136134
t.error(err)
@@ -157,7 +155,7 @@ test('Should emit a response event with the error set', t => {
157155
request: {
158156
params: {
159157
method: 'GET',
160-
path: '/test/doc/_search',
158+
path: '/test/_search',
161159
body: '',
162160
querystring: 'q=foo%3Abar',
163161
headers: {
@@ -186,7 +184,6 @@ test('Should emit a response event with the error set', t => {
186184

187185
client.search({
188186
index: 'test',
189-
type: 'doc',
190187
q: 'foo:bar'
191188
}, {
192189
requestTimeout: 500

0 commit comments

Comments
 (0)