Skip to content

Commit 22850d7

Browse files
glynnbirdGlynn Bird
and
Glynn Bird
authoredNov 3, 2022
10.1.0 (#312)
* dependency bump - bump all dependencies to latest versions * set minimum node version to 14 - just to keep up with progress (18 is current LTS) * update Travis node versions * bump Travis Ubuntu host to "focal" Co-authored-by: Glynn Bird <glynnbird@apache.org>
1 parent d6c6c3a commit 22850d7

14 files changed

+3252
-4317
lines changed
 

‎.travis.yml

+3-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,9 @@
1+
dist: focal
12
language: "node_js"
23
node_js:
3-
- "12"
44
- "14"
5+
- "16"
6+
- "18"
57
services:
68
- docker
79
os:

‎examples/lazy_creation_of_views.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ module.exports = function () {
4545
if (!retries) {
4646
retries = 0
4747
}
48-
users.insert({ emailAddress: emailAddress, secret: secret, name: name }, secret,
48+
users.insert({ emailAddress, secret, name }, secret,
4949
function (e, b, h) {
5050
if (e && e.message === 'no_db_file' && retries < 1) {
5151
return createUsersDatabase(emailAddress, secret, name, retries)

‎lib/nano.js

+46-46
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
// License for the specific language governing permissions and limitations under
1111
// the License.
1212

13-
const { HttpsCookieAgent, HttpCookieAgent } = require('http-cookie-agent')
13+
const { HttpsCookieAgent, HttpCookieAgent } = require('http-cookie-agent/http')
1414
const { URL } = require('url')
1515
const assert = require('assert')
1616
const querystring = require('qs')
@@ -126,7 +126,7 @@ module.exports = exports = function dbScope (cfg) {
126126
// let parsed
127127
const responseHeaders = Object.assign({
128128
uri: scrubURL(req.url),
129-
statusCode: statusCode
129+
statusCode
130130
}, response.headers)
131131
if (!response.status) {
132132
if (axios.isCancel(response)) {
@@ -139,7 +139,7 @@ module.exports = exports = function dbScope (cfg) {
139139
return
140140
}
141141

142-
log({ err: 'socket', body: body, headers: responseHeaders })
142+
log({ err: 'socket', body, headers: responseHeaders })
143143
if (reject) {
144144
reject(new Error(`error happened in your connection. Reason: ${response.message}`))
145145
}
@@ -162,7 +162,7 @@ module.exports = exports = function dbScope (cfg) {
162162
} */
163163

164164
if (statusCode >= 200 && statusCode < 400) {
165-
log({ err: null, body: body, headers: responseHeaders })
165+
log({ err: null, body, headers: responseHeaders })
166166
if (resolve) {
167167
resolve(body)
168168
}
@@ -187,7 +187,7 @@ module.exports = exports = function dbScope (cfg) {
187187
// scrub credentials
188188
scrubRequest(req)
189189

190-
log({ err: 'couch', body: body, headers: responseHeaders })
190+
log({ err: 'couch', body, headers: responseHeaders })
191191

192192
const message = body.message || 'couch returned ' + statusCode
193193
const errors = new Error(message)
@@ -223,7 +223,7 @@ module.exports = exports = function dbScope (cfg) {
223223

224224
const responseHeaders = Object.assign({
225225
uri: req.url,
226-
statusCode: statusCode
226+
statusCode
227227
}, response.headers)
228228

229229
const error = new Error(message)
@@ -267,7 +267,7 @@ module.exports = exports = function dbScope (cfg) {
267267

268268
const req = Object.assign({
269269
method: (opts.method || 'GET'),
270-
headers: headers,
270+
headers,
271271
uri: cfg.url
272272
}, {
273273
...cfg.requestDefaults,
@@ -385,8 +385,8 @@ module.exports = exports = function dbScope (cfg) {
385385
req.method = req.method.toLowerCase()
386386
req.params = req.qs
387387
delete req.qs
388-
req.paramsSerializer = (params) => {
389-
return querystring.stringify(params, { arrayFormat: 'brackets' })
388+
req.paramsSerializer = {
389+
serialize: (params) => querystring.stringify(params, { arrayFormat: 'brackets' })
390390
}
391391
req.data = req.body
392392
delete req.body
@@ -453,7 +453,7 @@ module.exports = exports = function dbScope (cfg) {
453453
db: '_session',
454454
form: {
455455
name: username,
456-
password: password
456+
password
457457
}
458458
}, callback)
459459
}
@@ -579,7 +579,7 @@ module.exports = exports = function dbScope (cfg) {
579579
count = 1
580580
}
581581
count = count || 1
582-
return relax({ method: 'GET', path: '_uuids', qs: { count: count } }, callback)
582+
return relax({ method: 'GET', path: '_uuids', qs: { count } }, callback)
583583
}
584584

585585
// http://guide.couchdb.org/draft/replication.html
@@ -616,7 +616,7 @@ module.exports = exports = function dbScope (cfg) {
616616
db: '_replicator',
617617
method: 'DELETE',
618618
path: id,
619-
qs: Object.assign(opts, { rev: rev })
619+
qs: Object.assign(opts, { rev })
620620
}
621621
return relax(req, callback)
622622
}
@@ -658,7 +658,7 @@ module.exports = exports = function dbScope (cfg) {
658658
db: dbName,
659659
doc: docName,
660660
method: 'DELETE',
661-
qs: { rev: rev }
661+
qs: { rev }
662662
}, callback)
663663
}
664664

@@ -787,7 +787,7 @@ module.exports = exports = function dbScope (cfg) {
787787
path: viewPath,
788788
method: 'POST',
789789
qs: qs1,
790-
body: body,
790+
body,
791791
stream: meta.stream
792792
}, callback)
793793
} else if (qs1 && qs1.queries) {
@@ -798,7 +798,7 @@ module.exports = exports = function dbScope (cfg) {
798798
path: viewPath,
799799
method: 'POST',
800800
qs: qs1,
801-
body: body
801+
body
802802
}, callback)
803803
} else {
804804
const req = {
@@ -858,7 +858,7 @@ module.exports = exports = function dbScope (cfg) {
858858
return view(ddoc, viewName + '/' + encodeURIComponent(docName), {
859859
type: 'update',
860860
method: 'PUT',
861-
body: body
861+
body
862862
}, callback)
863863
}
864864

@@ -925,8 +925,8 @@ module.exports = exports = function dbScope (cfg) {
925925
method: 'PUT',
926926
contentType: 'multipart/related',
927927
doc: docName,
928-
qs: qs,
929-
multipart: multipart
928+
qs,
929+
multipart
930930
}, callback)
931931
}
932932

@@ -957,7 +957,7 @@ module.exports = exports = function dbScope (cfg) {
957957
db: dbName,
958958
att: attName,
959959
method: 'PUT',
960-
contentType: contentType,
960+
contentType,
961961
doc: docName,
962962
qs: opts,
963963
body: att,
@@ -1004,7 +1004,7 @@ module.exports = exports = function dbScope (cfg) {
10041004
att: attName,
10051005
method: 'DELETE',
10061006
doc: docName,
1007-
qs: qs
1007+
qs
10081008
}, callback)
10091009
}
10101010

@@ -1071,7 +1071,7 @@ module.exports = exports = function dbScope (cfg) {
10711071
return relax({
10721072
db: dbName,
10731073
path: '_partition/' + encodeURIComponent(partitionKey) + '/_all_docs',
1074-
qs: qs,
1074+
qs,
10751075
stream: true
10761076
})
10771077
}
@@ -1157,8 +1157,8 @@ module.exports = exports = function dbScope (cfg) {
11571157
return changesDbAsStream(dbName, qs)
11581158
},
11591159
changesReader: new ChangesReader(dbName, relax),
1160-
auth: auth,
1161-
session: session,
1160+
auth,
1161+
session,
11621162
insert: insertDoc,
11631163
get: getDoc,
11641164
head: headDoc,
@@ -1167,7 +1167,7 @@ module.exports = exports = function dbScope (cfg) {
11671167
list: listDoc,
11681168
listAsStream: listDocAsStream,
11691169
fetch: fetchDocs,
1170-
fetchRevs: fetchRevs,
1170+
fetchRevs,
11711171
config: { url: cfg.url, db: dbName },
11721172
multipart: {
11731173
insert: insertMultipart,
@@ -1181,17 +1181,17 @@ module.exports = exports = function dbScope (cfg) {
11811181
},
11821182
show: showDoc,
11831183
atomic: updateWithHandler,
1184-
updateWithHandler: updateWithHandler,
1184+
updateWithHandler,
11851185
baseView: view,
11861186
search: viewSearch,
11871187
searchAsStream: viewSearchAsStream,
11881188
view: viewDocs,
11891189
viewAsStream: viewDocsAsStream,
1190-
find: find,
1191-
findAsStream: findAsStream,
1192-
createIndex: createIndex,
1193-
viewWithList: viewWithList,
1194-
viewWithListAsStream: viewWithListAsStream,
1190+
find,
1191+
findAsStream,
1192+
createIndex,
1193+
viewWithList,
1194+
viewWithListAsStream,
11951195
server: serverScope,
11961196
replication: {
11971197
enable: function (target, opts, cb) {
@@ -1204,15 +1204,15 @@ module.exports = exports = function dbScope (cfg) {
12041204
return queryReplication(id, opts, cb)
12051205
}
12061206
},
1207-
partitionInfo: partitionInfo,
1208-
partitionedList: partitionedList,
1209-
partitionedListAsStream: partitionedListAsStream,
1210-
partitionedFind: partitionedFind,
1211-
partitionedFindAsStream: partitionedFindAsStream,
1212-
partitionedSearch: partitionedSearch,
1213-
partitionedSearchAsStream: partitionedSearchAsStream,
1214-
partitionedView: partitionedView,
1215-
partitionedViewAsStream: partitionedViewAsStream
1207+
partitionInfo,
1208+
partitionedList,
1209+
partitionedListAsStream,
1210+
partitionedFind,
1211+
partitionedFindAsStream,
1212+
partitionedSearch,
1213+
partitionedSearchAsStream,
1214+
partitionedView,
1215+
partitionedViewAsStream
12161216
}
12171217

12181218
docScope.view.compact = function (ddoc, cb) {
@@ -1240,18 +1240,18 @@ module.exports = exports = function dbScope (cfg) {
12401240
query: queryReplication
12411241
},
12421242
changes: changesDb,
1243-
updates: updates
1243+
updates
12441244
},
12451245
use: docModule,
12461246
scope: docModule,
12471247
request: relax,
1248-
relax: relax,
1248+
relax,
12491249
dinosaur: relax,
1250-
auth: auth,
1251-
session: session,
1252-
updates: updates,
1253-
uuids: uuids,
1254-
info: info
1250+
auth,
1251+
session,
1252+
updates,
1253+
uuids,
1254+
info
12551255
})
12561256

12571257
const db = maybeExtractDatabaseComponent()

‎package-lock.json

+3,156-4,223
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

‎package.json

+13-13
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
"license": "Apache-2.0",
55
"homepage": "http://github.com/apache/couchdb-nano",
66
"repository": "http://github.com/apache/couchdb-nano",
7-
"version": "10.0.0",
7+
"version": "10.1.0",
88
"author": "Apache CouchDB <dev@couchdb.apache.org> (http://couchdb.apache.org)",
99
"keywords": [
1010
"couchdb",
@@ -17,19 +17,19 @@
1717
"database"
1818
],
1919
"dependencies": {
20-
"http-cookie-agent": "^1.0.5",
21-
"@types/tough-cookie": "^4.0.0",
22-
"axios": "^0.26.1",
23-
"node-abort-controller": "^3.0.1",
24-
"qs": "^6.10.3",
25-
"tough-cookie": "^4.0.0"
20+
"http-cookie-agent": "^4.0.2",
21+
"@types/tough-cookie": "^4.0.2",
22+
"axios": "^1.1.3",
23+
"qs": "^6.11.0",
24+
"tough-cookie": "^4.1.2",
25+
"node-abort-controller": "^3.0.1"
2626
},
2727
"devDependencies": {
28-
"@types/node": "^17.0.22",
29-
"jest": "^27.5.1",
30-
"nock": "^13.2.4",
31-
"standard": "^16.0.4",
32-
"typescript": "^4.1.3"
28+
"@types/node": "^18.11.9",
29+
"jest": "^29.2.2",
30+
"nock": "^13.2.9",
31+
"standard": "^17.0.0",
32+
"typescript": "^4.8.4"
3333
},
3434
"scripts": {
3535
"standard": "standard --fix",
@@ -39,7 +39,7 @@
3939
"main": "./lib/nano.js",
4040
"types": "./lib/nano.d.ts",
4141
"engines": {
42-
"node": ">=10"
42+
"node": ">=14"
4343
},
4444
"pre-commit": [
4545
"test"

‎test/database.replicate.test.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ test('should be able to send replication request with URLs - POST /_replicate -
4343
const source = 'http://mydomain1.com/source'
4444
const target = 'https://mydomain2.com/target'
4545
const scope = nock(COUCH_URL)
46-
.post('/_replicate', { source: source, target: target })
46+
.post('/_replicate', { source, target })
4747
.reply(200, response)
4848

4949
// test POST /_replicate
@@ -58,7 +58,7 @@ test('should be able to supply additional parameters - POST /_replicate - nano.d
5858
const target = 'https://mydomain2.com/target'
5959
const opts = { filter: 'ddoc/func', continuous: true }
6060
const scope = nock(COUCH_URL)
61-
.post('/_replicate', Object.assign(opts, { source: source, target: target }))
61+
.post('/_replicate', Object.assign(opts, { source, target }))
6262
.reply(200, response)
6363

6464
// test POST /_replicate

‎test/database.replication.enable.test.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ test('should be able to send replication request with URLs - POST /_replicator -
3737
const source = 'http://mydomain1.com/source'
3838
const target = 'https://mydomain2.com/target'
3939
const scope = nock(COUCH_URL)
40-
.post('/_replicator', { source: source, target: target })
40+
.post('/_replicator', { source, target })
4141
.reply(200, response)
4242

4343
// test POST /_replicator
@@ -66,7 +66,7 @@ test('should be able to supply additional parameters - POST /_replicator - nano.
6666
const target = 'https://mydomain2.com/target'
6767
const opts = { filter: 'ddoc/func', continuous: true }
6868
const scope = nock(COUCH_URL)
69-
.post('/_replicator', Object.assign(opts, { source: source, target: target }))
69+
.post('/_replicator', Object.assign(opts, { source, target }))
7070
.reply(200, response)
7171

7272
// test POST /_replicator

‎test/design.view.test.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -78,12 +78,12 @@ test('should be able to access a MapReduce view with keys - POST /db/_design/ddo
7878
]
7979
}
8080
const scope = nock(COUCH_URL)
81-
.post('/db/_design/ddoc/_view/viewname', { keys: keys })
81+
.post('/db/_design/ddoc/_view/viewname', { keys })
8282
.reply(200, response)
8383

8484
// test POST /db/_design/ddoc/_view/viewname
8585
const db = nano.db.use('db')
86-
const p = await db.view('ddoc', 'viewname', { keys: keys })
86+
const p = await db.view('ddoc', 'viewname', { keys })
8787
expect(p).toStrictEqual(response)
8888
expect(scope.isDone()).toBe(true)
8989
})

‎test/document.bulk.test.js

+4-4
Original file line numberDiff line numberDiff line change
@@ -28,12 +28,12 @@ test('should be able to insert documents in bulk - POST /db/_bulk_docs - db.bulk
2828
{ ok: true, id: 'z', rev: '1-789' }
2929
]
3030
const scope = nock(COUCH_URL)
31-
.post('/db/_bulk_docs', { docs: docs })
31+
.post('/db/_bulk_docs', { docs })
3232
.reply(200, response)
3333

3434
// test POST /db/_bulk_docs
3535
const db = nano.db.use('db')
36-
const p = await db.bulk({ docs: docs })
36+
const p = await db.bulk({ docs })
3737
expect(p).toStrictEqual(response)
3838
expect(scope.isDone()).toBe(true)
3939
})
@@ -46,11 +46,11 @@ test('should be able to handle missing database - POST /db/_bulk_docs - db.bulk'
4646
reason: 'Database does not exist.'
4747
}
4848
const scope = nock(COUCH_URL)
49-
.post('/db/_bulk_docs', { docs: docs })
49+
.post('/db/_bulk_docs', { docs })
5050
.reply(404, response)
5151

5252
// test POST /db/_bulk_docs
5353
const db = nano.db.use('db')
54-
await expect(db.bulk({ docs: docs })).rejects.toThrow('Database does not exist.')
54+
await expect(db.bulk({ docs })).rejects.toThrow('Database does not exist.')
5555
expect(scope.isDone()).toBe(true)
5656
})

‎test/document.changesreader.test.js

+9-9
Original file line numberDiff line numberDiff line change
@@ -239,7 +239,7 @@ test('should handle the batchSize parameter - db.changesReader.start', async ()
239239
const limit = 44
240240
nock(COUCH_URL)
241241
.post(changeURL)
242-
.query({ feed: 'longpoll', timeout: 60000, since: 'now', limit: limit, include_docs: false })
242+
.query({ feed: 'longpoll', timeout: 60000, since: 'now', limit, include_docs: false })
243243
.reply(200, { results: [], last_seq: '1-0', pending: 0 })
244244
.post(changeURL)
245245
.delay(2000)
@@ -263,13 +263,13 @@ test('should respect the since parameter db.changesReader.start', async () => {
263263
const since = 'thedawnoftime'
264264
nock(COUCH_URL)
265265
.post(changeURL)
266-
.query({ feed: 'longpoll', timeout: 60000, since: since, limit: limit, include_docs: false })
266+
.query({ feed: 'longpoll', timeout: 60000, since, limit, include_docs: false })
267267
.reply(200, { results: [], last_seq: '1-0', pending: 0 })
268268
.post(changeURL)
269269
.delay(2000)
270270
.reply(500)
271271
const db = nano.db.use(DBNAME)
272-
const cr = db.changesReader.start({ batchSize: limit, since: since })
272+
const cr = db.changesReader.start({ batchSize: limit, since })
273273
return new Promise((resolve, reject) => {
274274
cr.on('seq', function (seq) {
275275
// after our initial call with since=thedawnoftime, we should get a reply with last_seq=0-1
@@ -286,13 +286,13 @@ test('should stop on no changes - db.changesReader.get', async () => {
286286
const batchSize = 45
287287
nock(COUCH_URL)
288288
.post(changeURL)
289-
.query({ feed: 'longpoll', timeout: 60000, since: since, limit: batchSize, include_docs: false })
289+
.query({ feed: 'longpoll', timeout: 60000, since, limit: batchSize, include_docs: false })
290290
.reply(200, { results: [], last_seq: '1-0', pending: 0 })
291291
.post(changeURL)
292292
.delay(2000)
293293
.reply(500)
294294
const db = nano.db.use(DBNAME)
295-
const cr = db.changesReader.get({ batchSize: batchSize, since: since })
295+
const cr = db.changesReader.get({ batchSize, since })
296296
return new Promise((resolve, reject) => {
297297
cr.on('seq', function (seq) {
298298
// after our initial call with since=now, we should get a reply with last_seq=0-1
@@ -317,7 +317,7 @@ test('stop after multiple batches - small batch stop - db.changesReader.get', as
317317
}
318318
nock(COUCH_URL)
319319
.post(changeURL)
320-
.query({ feed: 'longpoll', timeout: 60000, since: since, limit: batchSize, include_docs: false })
320+
.query({ feed: 'longpoll', timeout: 60000, since, limit: batchSize, include_docs: false })
321321
.reply(200, { results: batch1, last_seq: '45-0', pending: 2 })
322322
.post(changeURL)
323323
.query({ feed: 'longpoll', timeout: 60000, since: '45-0', limit: batchSize, include_docs: false })
@@ -327,7 +327,7 @@ test('stop after multiple batches - small batch stop - db.changesReader.get', as
327327
.reply(200, { results: [], last_seq: '50-0', pending: 0 })
328328

329329
const db = nano.db.use(DBNAME)
330-
const cr = db.changesReader.get({ batchSize: batchSize, since: since })
330+
const cr = db.changesReader.get({ batchSize, since })
331331
let batchCount = 0
332332
return new Promise((resolve, reject) => {
333333
cr.on('seq', function (seq) {
@@ -358,7 +358,7 @@ test('stop after multiple batches - zero stop - db.changesReader.get', async ()
358358
}
359359
nock(COUCH_URL)
360360
.post(changeURL)
361-
.query({ feed: 'longpoll', timeout: 60000, since: since, limit: batchSize, include_docs: false })
361+
.query({ feed: 'longpoll', timeout: 60000, since, limit: batchSize, include_docs: false })
362362
.reply(200, { results: batch1, last_seq: '45-0', pending: 2 })
363363
.post(changeURL)
364364
.query({ feed: 'longpoll', timeout: 60000, since: '45-0', limit: batchSize, include_docs: false })
@@ -368,7 +368,7 @@ test('stop after multiple batches - zero stop - db.changesReader.get', async ()
368368
.reply(200, { results: [], last_seq: '90-0', pending: 0 })
369369

370370
const db = nano.db.use(DBNAME)
371-
const cr = db.changesReader.get({ batchSize: batchSize, since: since })
371+
const cr = db.changesReader.get({ batchSize, since })
372372
let batchCount = 0
373373
return new Promise((resolve, reject) => {
374374
cr.on('seq', function (seq) {

‎test/document.fetch.test.js

+6-6
Original file line numberDiff line numberDiff line change
@@ -68,12 +68,12 @@ test('should be able to fetch a list of documents - POST /db/_all_docs - db.fetc
6868
]
6969
}
7070
const scope = nock(COUCH_URL)
71-
.post('/db/_all_docs?include_docs=true', { keys: keys })
71+
.post('/db/_all_docs?include_docs=true', { keys })
7272
.reply(200, response)
7373

7474
// test POST /db/_all_docs
7575
const db = nano.db.use('db')
76-
const p = await db.fetch({ keys: keys })
76+
const p = await db.fetch({ keys })
7777
expect(p).toStrictEqual(response)
7878
expect(scope.isDone()).toBe(true)
7979
})
@@ -127,12 +127,12 @@ test('should be able to fetch a list of documents with opts - POST /db/_all_docs
127127
]
128128
}
129129
const scope = nock(COUCH_URL)
130-
.post('/db/_all_docs?include_docs=true&descending=true', { keys: keys })
130+
.post('/db/_all_docs?include_docs=true&descending=true', { keys })
131131
.reply(200, response)
132132

133133
// test POST /db/_all_docs
134134
const db = nano.db.use('db')
135-
const p = await db.fetch({ keys: keys }, { descending: true })
135+
const p = await db.fetch({ keys }, { descending: true })
136136
expect(p).toStrictEqual(response)
137137
expect(scope.isDone()).toBe(true)
138138
})
@@ -145,12 +145,12 @@ test('should be able to handle 404 - POST /db/_all_docs - db.fetch', async () =>
145145
reason: 'missing'
146146
}
147147
const scope = nock(COUCH_URL)
148-
.post('/db/_all_docs?include_docs=true', { keys: keys })
148+
.post('/db/_all_docs?include_docs=true', { keys })
149149
.reply(404, response)
150150

151151
// test POST /db/_all_docs
152152
const db = nano.db.use('db')
153-
await expect(db.fetch({ keys: keys })).rejects.toThrow('missing')
153+
await expect(db.fetch({ keys })).rejects.toThrow('missing')
154154
expect(scope.isDone()).toBe(true)
155155
})
156156

‎test/document.fetchRevs.test.js

+6-6
Original file line numberDiff line numberDiff line change
@@ -50,12 +50,12 @@ test('should be able to fetch a list of document revisions - POST /db/_all_docs
5050
]
5151
}
5252
const scope = nock(COUCH_URL)
53-
.post('/db/_all_docs', { keys: keys })
53+
.post('/db/_all_docs', { keys })
5454
.reply(200, response)
5555

5656
// test POST /db/_all_docs
5757
const db = nano.db.use('db')
58-
const p = await db.fetchRevs({ keys: keys })
58+
const p = await db.fetchRevs({ keys })
5959
expect(p).toStrictEqual(response)
6060
expect(scope.isDone()).toBe(true)
6161
})
@@ -91,12 +91,12 @@ test('should be able to fetch a list of document revisions with opts - POST /db
9191
]
9292
}
9393
const scope = nock(COUCH_URL)
94-
.post('/db/_all_docs?descending=true', { keys: keys })
94+
.post('/db/_all_docs?descending=true', { keys })
9595
.reply(200, response)
9696

9797
// test POST /db/_all_docs
9898
const db = nano.db.use('db')
99-
const p = await db.fetchRevs({ keys: keys }, { descending: true })
99+
const p = await db.fetchRevs({ keys }, { descending: true })
100100
expect(p).toStrictEqual(response)
101101
expect(scope.isDone()).toBe(true)
102102
})
@@ -109,12 +109,12 @@ test('should be able to handle 404 - POST /db/_all_docs - db.fetchRevs', async (
109109
reason: 'missing'
110110
}
111111
const scope = nock(COUCH_URL)
112-
.post('/db/_all_docs', { keys: keys })
112+
.post('/db/_all_docs', { keys })
113113
.reply(404, response)
114114

115115
// test POST /db/_all_docs
116116
const db = nano.db.use('db')
117-
await expect(db.fetchRevs({ keys: keys })).rejects.toThrow('missing')
117+
await expect(db.fetchRevs({ keys })).rejects.toThrow('missing')
118118
expect(scope.isDone()).toBe(true)
119119
})
120120

‎test/nano.request.test.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -420,7 +420,7 @@ test('check request handles cookies - nano.request', async () => {
420420
path: '_session',
421421
form: {
422422
name: username,
423-
password: password
423+
password
424424
},
425425
jar: true
426426
}

‎test/notnocked.test.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ if (process.env.TRAVIS) {
4343
{ _id: 'catinthehat', name: 'The Cat in the Hat', description: 'Tall cat with red and white striped hat and bow tie', year: 1957 },
4444
{ _id: 'dummy', name: 'to be deleted' }
4545
]
46-
await db.bulk({ docs: docs })
46+
await db.bulk({ docs })
4747
})
4848

4949
test('should be able to get database info - nano.db.bulk', async () => {

0 commit comments

Comments
 (0)
Please sign in to comment.