You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@couchdb.apache.org by gl...@apache.org on 2020/02/12 11:26:02 UTC

[couchdb-nano] 14/15: tidy up

This is an automated email from the ASF dual-hosted git repository.

glynnbird pushed a commit to branch jest
in repository https://gitbox.apache.org/repos/asf/couchdb-nano.git

commit a7ba7590da2af81e8dddabe543dc7e205f85d60f
Author: Glynn Bird <gl...@gmail.com>
AuthorDate: Wed Feb 12 09:05:24 2020 +0000

    tidy up
---
 test/attachment.destroy.test.js           |  10 +--
 test/attachment.getAsStream.test.js       |   2 +-
 test/database.compact.test.js             |   4 +-
 test/database.get.test.js                 |   2 +-
 test/database.list.test.js                |   2 +-
 test/database.replicate.test.js           |   2 +-
 test/database.replication.disable.test.js |   6 +-
 test/design.atomic.test.js                |   6 +-
 test/design.createIndex.test.js           |   4 +-
 test/design.search.test.js                |   4 +-
 test/design.show.test.js                  |   4 +-
 test/design.view.test.js                  |  10 +--
 test/design.viewWithList.test.js          |   2 +-
 test/document.copy.test.js                |   4 +-
 test/document.fetch.test.js               |   2 +-
 test/document.fetchRevs.test.js           |   2 +-
 test/document.get.test.js                 |   8 +--
 test/document.head.test.js                |   6 +-
 test/multipart.get.test.js                |   6 +-
 test/multipart.insert.test.js             |  10 +--
 test/nano.auth.test.js                    |   2 +-
 test/nano.logger.test.js                  |   2 +-
 test/nano.request.test.js                 |   2 +-
 test/nano.session.test.js                 |   2 +-
 test/nano.updates.test.js                 |   6 +-
 test/notnocked.test.js                    | 111 ++++++++++++++++++++++++++++++
 test/partition.find.test.js               |   4 +-
 test/partition.findAsStream.test.js       |   2 +-
 test/partition.info.test.js               |   6 +-
 test/partition.list.test.js               |   8 +--
 test/partition.listAsStream.test.js       |   4 +-
 test/partition.search.test.js             |   6 +-
 test/partition.searchAsStream.test.js     |   2 +-
 test/partition.view.test.js               |   6 +-
 test/partition.viewAsStream.test.js       |   4 +-
 35 files changed, 187 insertions(+), 76 deletions(-)

diff --git a/test/attachment.destroy.test.js b/test/attachment.destroy.test.js
index 0a225ff..64d244f 100644
--- a/test/attachment.destroy.test.js
+++ b/test/attachment.destroy.test.js
@@ -19,21 +19,21 @@ afterEach(() => {
   nock.cleanAll()
 })
 
-test('should be able to destroy a document - DELETE /db/id/attname - db.attachment.destroy', async () => {
+test('should be able to destroy an attachment - DELETE /db/id/attname - db.attachment.destroy', async () => {
   // mocks
   const response = { ok: true, id: 'id', rev: '2-456' }
   const scope = nock(COUCH_URL)
     .delete('/db/id/logo.jpg?rev=1-123')
     .reply(200, response)
 
-  // test DELETE /db/id
+  // test DELETE DELETE /db/id/attname
   const db = nano.db.use('db')
   const p = await db.attachment.destroy('id', 'logo.jpg', { rev: '1-123' })
   expect(p).toStrictEqual(response)
   expect(scope.isDone()).toBe(true)
 })
 
-test('should be able to handle 409 conflicts - DELETE /db/id - db.attachment.destroy', async () => {
+test('should be able to handle 409 conflicts - DELETE /db/id/attname- db.attachment.destroy', async () => {
   // mocks
   const response = {
     error: 'conflict',
@@ -43,7 +43,7 @@ test('should be able to handle 409 conflicts - DELETE /db/id - db.attachment.des
     .delete('/db/id/logo.jpg?rev=1-123')
     .reply(409, response)
 
-  // test DELETE /db/id
+  // test DELETE /db/id/attname
   const db = nano.db.use('db')
   await expect(db.attachment.destroy('id', 'logo.jpg', { rev: '1-123' })).rejects.toThrow('Document update conflict.')
   expect(scope.isDone()).toBe(true)
@@ -57,7 +57,7 @@ test('should detect missing doc id - db.attachment.destroy', async () => {
   await expect(db.attachment.destroy('', 'logo.jpg')).rejects.toThrow('Invalid parameters')
 })
 
-test('should detect missing parameters (callback) - db.attachment.get', async () => {
+test('should detect missing parameters (callback) - db.attachment.destroy', async () => {
   const db = nano.db.use('db')
   return new Promise((resolve, reject) => {
     db.attachment.destroy(undefined, undefined, undefined, (err, data) => {
diff --git a/test/attachment.getAsStream.test.js b/test/attachment.getAsStream.test.js
index 4598417..f184655 100644
--- a/test/attachment.getAsStream.test.js
+++ b/test/attachment.getAsStream.test.js
@@ -20,7 +20,7 @@ afterEach(() => {
   nock.cleanAll()
 })
 
-test('should be able to get an attachment as a stream - GET /db/id/attname - db.attachment.get', async () => {
+test('should be able to get an attachment as a stream - GET /db/id/attname - db.attachment.getAsStream', async () => {
   // mocks
   const scope = nock(COUCH_URL)
     .get('/db/id/transparent.gif')
diff --git a/test/database.compact.test.js b/test/database.compact.test.js
index 420a5ac..c046af9 100644
--- a/test/database.compact.test.js
+++ b/test/database.compact.test.js
@@ -32,7 +32,7 @@ test('should be able to send compaction request - POST /db/_compact - nano.db.co
   expect(scope.isDone()).toBe(true)
 })
 
-test('should be able to send compaction request with design doc - POST /db/_compact - nano.db.compact', async () => {
+test('should be able to send compaction request with design doc - POST /db/_compact/ddoc - nano.db.compact', async () => {
   // mocks
   const scope = nock(COUCH_URL)
     .post('/db/_compact/ddoc')
@@ -71,7 +71,7 @@ test('should be able to send compaction request from db.compact - POST /db/_comp
   expect(scope.isDone()).toBe(true)
 })
 
-test('should be able to send compaction request with design doc from db.view.compact - POST /db/_compact - db.view.compact', async () => {
+test('should be able to send compaction request with design doc from db.view.compact - POST /db/_compact/ddoc - db.view.compact', async () => {
   // mocks
   const scope = nock(COUCH_URL)
     .post('/db/_compact/ddoc')
diff --git a/test/database.get.test.js b/test/database.get.test.js
index 454940d..6cbf478 100644
--- a/test/database.get.test.js
+++ b/test/database.get.test.js
@@ -74,7 +74,7 @@ test('should be able to fetch the database info - GET /db - db.info', async () =
   expect(scope.isDone()).toBe(true)
 })
 
-test('should handle missing database - PUT /db - nano.db.create', async () => {
+test('should handle missing database - GET /db - nano.db.get', async () => {
   // mocks
   const scope = nock(COUCH_URL)
     .get('/db')
diff --git a/test/database.list.test.js b/test/database.list.test.js
index e07c4ea..abe6e10 100644
--- a/test/database.list.test.js
+++ b/test/database.list.test.js
@@ -26,7 +26,7 @@ test('should be to get list of databases - GET /_all_dbs - nano.db.list', async
     .get('/_all_dbs')
     .reply(200, response)
 
-  // test GET /db/_all_dbs
+  // test GET /_all_dbs
   const p = await nano.db.list()
   expect(p).toStrictEqual(response)
   expect(scope.isDone()).toBe(true)
diff --git a/test/database.replicate.test.js b/test/database.replicate.test.js
index a133cf8..2120d86 100644
--- a/test/database.replicate.test.js
+++ b/test/database.replicate.test.js
@@ -26,7 +26,7 @@ afterEach(() => {
   nock.cleanAll()
 })
 
-test('should be able to send replication request with local database names- POST /_replicate - nano.db.replicate', async () => {
+test('should be able to send replication request with local database names - POST /_replicate - nano.db.replicate', async () => {
   // mocks
   const scope = nock(COUCH_URL)
     .post('/_replicate', { source: COUCH_URL + '/source', target: COUCH_URL + '/target' })
diff --git a/test/database.replication.disable.test.js b/test/database.replication.disable.test.js
index da76cfc..dcef360 100644
--- a/test/database.replication.disable.test.js
+++ b/test/database.replication.disable.test.js
@@ -24,7 +24,7 @@ afterEach(() => {
   nock.cleanAll()
 })
 
-test('should be able to delete a replication - DELETE /_replicator - nano.db.replication.disable', async () => {
+test('should be able to delete a replication - DELETE /_replicator/id - nano.db.replication.disable', async () => {
   // mocks
   const scope = nock(COUCH_URL)
     .delete('/_replicator/rep1')
@@ -37,7 +37,7 @@ test('should be able to delete a replication - DELETE /_replicator - nano.db.rep
   expect(scope.isDone()).toBe(true)
 })
 
-test('should be able to handle a 404 - DELETE /_replicator - nano.db.replication.disable', async () => {
+test('should be able to handle a 404 - DELETE /_replicator/id - nano.db.replication.disable', async () => {
   // mocks
   const scope = nock(COUCH_URL)
     .delete('/_replicator/rep1')
@@ -64,7 +64,7 @@ test('should detect missing parameters (callback) - nano.db.replication.disable'
   })
 })
 
-test('should be able to delete a replication from db.replication.disable - DELETE /_replicator - db.replication.disable', async () => {
+test('should be able to delete a replication from db.replication.disable - DELETE /_replicator/id - db.replication.disable', async () => {
   // mocks
   const scope = nock(COUCH_URL)
     .delete('/_replicator/rep1')
diff --git a/test/design.atomic.test.js b/test/design.atomic.test.js
index 0382943..5c659a5 100644
--- a/test/design.atomic.test.js
+++ b/test/design.atomic.test.js
@@ -33,7 +33,7 @@ test('should be able to use an update function - PUT /db/_design/ddoc/_update/up
     .put('/db/_design/ddoc/_update/updatename/docid')
     .reply(200, response)
 
-  // test POST /db/_find
+  // test PUT /db/_design/ddoc/_update/updatename/docid
   const db = nano.db.use('db')
   const p = await db.atomic('ddoc', 'updatename', 'docid')
   expect(p).toStrictEqual(response)
@@ -55,7 +55,7 @@ test('should be able to use an update function with body - PUT /db/_design/ddoc/
     .put('/db/_design/ddoc/_update/updatename/docid', body)
     .reply(200, response)
 
-  // test POST /db/_find
+  // test PUT /db/_design/ddoc/_update/updatename/docid
   const db = nano.db.use('db')
   const p = await db.atomic('ddoc', 'updatename', 'docid', body)
   expect(p).toStrictEqual(response)
@@ -73,7 +73,7 @@ test('should be able to handle 404 - db.atomic', async () => {
     .put('/db/_design/ddoc/_update/updatename/docid', body)
     .reply(404, response)
 
-  // test GET /db
+  // test PUT /db/_design/ddoc/_update/updatename/docid
   const db = nano.db.use('db')
   await expect(db.atomic('ddoc', 'updatename', 'docid', body)).rejects.toThrow('missing')
   expect(scope.isDone()).toBe(true)
diff --git a/test/design.createIndex.test.js b/test/design.createIndex.test.js
index bd7bdcc..fbb1f53 100644
--- a/test/design.createIndex.test.js
+++ b/test/design.createIndex.test.js
@@ -19,7 +19,7 @@ afterEach(() => {
   nock.cleanAll()
 })
 
-test('should be able to create an index - POST /db/_index - db.index', async () => {
+test('should be able to create an index - POST /db/_index - db.createIndex', async () => {
   // mocks
   const indexDef = {
     index: {
@@ -45,7 +45,7 @@ test('should be able to create an index - POST /db/_index - db.index', async ()
   expect(scope.isDone()).toBe(true)
 })
 
-test('should handle 404 - POST /db/_index - db.index', async () => {
+test('should handle 404 - POST /db/_index - db.createIndex', async () => {
   // mocks
   const indexDef = {
     index: {
diff --git a/test/design.search.test.js b/test/design.search.test.js
index e7e8e42..5c9181f 100644
--- a/test/design.search.test.js
+++ b/test/design.search.test.js
@@ -33,7 +33,7 @@ test('should be able to access a search index - POST /db/_design/ddoc/_search/se
     .post('/db/_design/ddoc/_search/searchname', params)
     .reply(200, response)
 
-  // test GET /db
+  // test POST /db/_design/ddoc/_search/searchnameGET /db
   const db = nano.db.use('db')
   const p = await db.search('ddoc', 'searchname', params)
   expect(p).toStrictEqual(response)
@@ -51,7 +51,7 @@ test('should be able to handle 404 - db.search', async () => {
     .post('/db/_design/ddoc/_search/searchname', params)
     .reply(404, response)
 
-  // test GET /db
+  // test POST /db/_design/ddoc/_search/searchname
   const db = nano.db.use('db')
   await expect(db.search('ddoc', 'searchname', params)).rejects.toThrow('missing')
   expect(scope.isDone()).toBe(true)
diff --git a/test/design.show.test.js b/test/design.show.test.js
index 1097e89..e761f06 100644
--- a/test/design.show.test.js
+++ b/test/design.show.test.js
@@ -28,7 +28,7 @@ test('should be able to use a show function - GET /db/_design/ddoc/_show/shownam
     .get('/db/_design/ddoc/_show/showname/docid')
     .reply(200, showFunction(), { 'Content-type': 'text/plain' })
 
-  // test POST /db/_find
+  // test GET /db/_design/ddoc/_show/showname/docid
   const db = nano.db.use('db')
   const p = await db.show('ddoc', 'showname', 'docid')
   expect(p).toStrictEqual(showFunction())
@@ -45,7 +45,7 @@ test('should be able to handle 404 - db.show', async () => {
     .get('/db/_design/ddoc/_show/showname/docid')
     .reply(404, response)
 
-  // test GET /db
+  // test GET /db/_design/ddoc/_show/showname/docid
   const db = nano.db.use('db')
   await expect(db.show('ddoc', 'showname', 'docid')).rejects.toThrow('missing')
   expect(scope.isDone()).toBe(true)
diff --git a/test/design.view.test.js b/test/design.view.test.js
index 7a62626..e450946 100644
--- a/test/design.view.test.js
+++ b/test/design.view.test.js
@@ -30,7 +30,7 @@ test('should be able to access a MapReduce view - GET /db/_design/ddoc/_view/vie
     .get('/db/_design/ddoc/_view/viewname')
     .reply(200, response)
 
-  // test GET /db
+  // test GET /db/_design/ddoc/_view/viewname
   const db = nano.db.use('db')
   const p = await db.view('ddoc', 'viewname')
   expect(p).toStrictEqual(response)
@@ -61,7 +61,7 @@ test('should be able to access a MapReduce view with opts - GET /db/_design/ddoc
     .get('/db/_design/ddoc/_view/viewname?group=true&startkey="BA"&endkey="BQ"')
     .reply(200, response)
 
-  // test GET /db
+  // test GET /db/_design/ddoc/_view/viewname
   const db = nano.db.use('db')
   const p = await db.view('ddoc', 'viewname', { group: true, startkey: 'BA', endkey: 'BQ' })
   expect(p).toStrictEqual(response)
@@ -81,7 +81,7 @@ test('should be able to access a MapReduce view with keys - POST /db/_design/ddo
     .post('/db/_design/ddoc/_view/viewname', { keys: keys })
     .reply(200, response)
 
-  // test GET /db
+  // test POST /db/_design/ddoc/_view/viewname
   const db = nano.db.use('db')
   const p = await db.view('ddoc', 'viewname', { keys: keys })
   expect(p).toStrictEqual(response)
@@ -126,7 +126,7 @@ test('should be able to access a MapReduce view with queries - POST /db/_design/
     .post('/db/_design/ddoc/_view/viewname', { queries: opts.queries })
     .reply(200, response)
 
-  // test GET /db
+  // test POST /db/_design/ddoc/_view/viewname
   const db = nano.db.use('db')
   const p = await db.view('ddoc', 'viewname', opts)
   expect(p).toStrictEqual(response)
@@ -143,7 +143,7 @@ test('should be able to handle 404 - db.view', async () => {
     .get('/db/_design/ddoc/_view/viewname?group=true&startkey="BA"&endkey="BQ"')
     .reply(404, response)
 
-  // test GET /db
+  // test GET /db/_design/ddoc/_view/viewname
   const db = nano.db.use('db')
   await expect(db.view('ddoc', 'viewname', { group: true, startkey: 'BA', endkey: 'BQ' })).rejects.toThrow('missing')
   expect(scope.isDone()).toBe(true)
diff --git a/test/design.viewWithList.test.js b/test/design.viewWithList.test.js
index 92bb7f6..53c4a92 100644
--- a/test/design.viewWithList.test.js
+++ b/test/design.viewWithList.test.js
@@ -26,7 +26,7 @@ test('should be able to access a MapReduce view with a list - GET /db/_design/dd
     .get('/db/_design/ddoc/_list/listname/viewname')
     .reply(200, response, { 'Content-type': 'text/csv' })
 
-  // test GET /db
+  // test GET /db/_design/ddoc/_list/listname/viewname
   const db = nano.db.use('db')
   const p = await db.viewWithList('ddoc', 'viewname', 'listname')
   expect(p).toStrictEqual(response)
diff --git a/test/document.copy.test.js b/test/document.copy.test.js
index e5eb7d7..c9f74d4 100644
--- a/test/document.copy.test.js
+++ b/test/document.copy.test.js
@@ -26,7 +26,7 @@ test('should be able to copy a document - db.copy', async () => {
     .intercept('/db/rabbit1', 'COPY')
     .reply(200, response)
 
-  // test GET /db
+  // test COPY /db/id
   const db = nano.db.use('db')
   const p = await db.copy('rabbit1', 'rabbit2')
   expect(p).toStrictEqual(response)
@@ -52,7 +52,7 @@ test('should be able to copy a document in overwrite mode - db.copy', async () =
     .intercept('/db/rabbit1', 'COPY')
     .reply(200, response)
 
-  // test GET /db
+  // test HEAD /db/id2 + COPY /db/id1
   const db = nano.db.use('db')
   const p = await db.copy('rabbit1', 'rabbit2', { overwrite: true })
   expect(p).toStrictEqual(response)
diff --git a/test/document.fetch.test.js b/test/document.fetch.test.js
index bde243b..7ba3f0c 100644
--- a/test/document.fetch.test.js
+++ b/test/document.fetch.test.js
@@ -78,7 +78,7 @@ test('should be able to fetch a list of documents - POST /db/_all_docs - db.fetc
   expect(scope.isDone()).toBe(true)
 })
 
-test('should be able to fetch a list of documents with opts - GET /db/_all_docs - db.fetch', async () => {
+test('should be able to fetch a list of documents with opts - POST /db/_all_docs - db.fetch', async () => {
   // mocks
   const keys = ['1000501', '1000543', '100077']
   const response = {
diff --git a/test/document.fetchRevs.test.js b/test/document.fetchRevs.test.js
index aa6f3fa..9b87d25 100644
--- a/test/document.fetchRevs.test.js
+++ b/test/document.fetchRevs.test.js
@@ -60,7 +60,7 @@ test('should be able to fetch a list of document revisions - POST /db/_all_docs
   expect(scope.isDone()).toBe(true)
 })
 
-test('should be able to fetch a list of document revisions  with opts - GET /db/_all_docs - db.fetchRevs', async () => {
+test('should be able to fetch a list of document revisions  with opts - POST /db/_all_docs - db.fetchRevs', async () => {
   // mocks
   const keys = ['1000501', '1000543', '100077']
   const response = {
diff --git a/test/document.get.test.js b/test/document.get.test.js
index 4b45b5a..ea0ba64 100644
--- a/test/document.get.test.js
+++ b/test/document.get.test.js
@@ -26,7 +26,7 @@ test('should be able to get a document - GET /db/id - db.get', async () => {
     .get('/db/id')
     .reply(200, response)
 
-  // test GET /db
+  // test GET /db/id
   const db = nano.db.use('db')
   const p = await db.get('id')
   expect(p).toStrictEqual(response)
@@ -40,7 +40,7 @@ test('should be able to get a document from a partition - GET /db/pkey:id - db.g
     .get('/db/partkey%3Aid')
     .reply(200, response)
 
-  // test GET /db
+  // test GET /db/pkey:id
   const db = nano.db.use('db')
   const p = await db.get('partkey:id')
   expect(p).toStrictEqual(response)
@@ -54,7 +54,7 @@ test('should be able to get a document with options - GET /db/id?conflicts=true
     .get('/db/id?conflicts=true')
     .reply(200, response)
 
-  // test GET /db
+  // test GET /db/id?x=y
   const db = nano.db.use('db')
   const p = await db.get('id', { conflicts: true })
   expect(p).toStrictEqual(response)
@@ -71,7 +71,7 @@ test('should be able to handle 404 - GET /db/id - db.get', async () => {
     .get('/db/id')
     .reply(404, response)
 
-  // test GET /db
+  // test GET /db/id
   const db = nano.db.use('db')
   await expect(db.get('id')).rejects.toThrow('missing')
   expect(scope.isDone()).toBe(true)
diff --git a/test/document.head.test.js b/test/document.head.test.js
index 0dfd9f1..6555941 100644
--- a/test/document.head.test.js
+++ b/test/document.head.test.js
@@ -25,7 +25,7 @@ test('should be able to head a document - HEAD /db/id - db.head', async () => {
     .head('/db/id')
     .reply(200, '', { ETag: '1-123' })
 
-  // test GET /db
+  // test HEAD /db
   const db = nano.db.use('db')
   const p = await db.head('id')
   // headers get lowercased
@@ -39,7 +39,7 @@ test('should be able to head a document with callback - HEAD /db/id - db.head',
     .head('/db/id')
     .reply(200, '', { ETag: '1-123' })
 
-  // test GET /db
+  // test HEAD /db
   return new Promise((resolve, reject) => {
     const db = nano.db.use('db')
     db.head('id', (err, data, headers) => {
@@ -58,7 +58,7 @@ test('should be able to head a missing document - HEAD /db/id - db.head', async
     .head('/db/id')
     .reply(404, '')
 
-  // test GET /db
+  // test HEAD /db
   const db = nano.db.use('db')
   await expect(db.head('id')).rejects.toThrow('couch returned 404')
   expect(scope.isDone()).toBe(true)
diff --git a/test/multipart.get.test.js b/test/multipart.get.test.js
index 2db92eb..03b76e3 100644
--- a/test/multipart.get.test.js
+++ b/test/multipart.get.test.js
@@ -42,7 +42,7 @@ test('should be able to fetch a document with attachments - multipart GET /db -
     .get('/db/docid?attachments=true')
     .reply(200, multipartResponse, { 'content-type': 'multipart/related; boundary="e89b3e29388aef23453450d10e5aaed0"' })
 
-  // test POST /db
+  // test GET /db/id?attachments=true
   const db = nano.db.use('db')
   const p = await db.multipart.get('docid')
   expect(p.toString()).toStrictEqual(multipartResponse)
@@ -55,14 +55,14 @@ test('should be able to fetch a document with attachments with opts - multipart
     .get('/db/docid?attachments=true&conflicts=true')
     .reply(200, multipartResponse, { 'content-type': 'multipart/related; boundary="e89b3e29388aef23453450d10e5aaed0"' })
 
-  // test POST /db
+  // test GET /db/id?attachments=true&x=y
   const db = nano.db.use('db')
   const p = await db.multipart.get('docid', { conflicts: true })
   expect(p.toString()).toStrictEqual(multipartResponse)
   expect(scope.isDone()).toBe(true)
 })
 
-test('should be able to handle 404 - db.search', async () => {
+test('should be able to handle 404 - db.multipart.get', async () => {
   // mocks
   const response = {
     error: 'not_found',
diff --git a/test/multipart.insert.test.js b/test/multipart.insert.test.js
index 43f46b1..157a076 100644
--- a/test/multipart.insert.test.js
+++ b/test/multipart.insert.test.js
@@ -50,27 +50,27 @@ afterEach(() => {
   nock.cleanAll()
 })
 
-test('should be able to insert a document with attachments #1 - multipart POST /db - db.multipart.insert', async () => {
+test('should be able to insert a document with attachments #1 - multipart PUT /db/id - db.multipart.insert', async () => {
   // mocks
   const response = { ok: true, id: '8s8g8h8h9', rev: '1-123' }
   const scope = nock(COUCH_URL, { reqheaders: { 'content-type': h => h.includes('multipart/related') } })
     .put('/db/docid')
     .reply(200, response)
 
-  // test POST /db
+  // test PUT /db/id
   const db = nano.db.use('db')
   const p = await db.multipart.insert(doc, images, 'docid')
   expect(p).toStrictEqual(response)
   expect(scope.isDone()).toBe(true)
 })
 
-test('should be able to insert a document with attachments #2 - multipart POST /db - db.multipart.insert', async () => {
+test('should be able to insert a document with attachments #2 - multipart PUT /db/id - db.multipart.insert', async () => {
   const response = { ok: true, id: '8s8g8h8h9', rev: '1-123' }
   const scope = nock(COUCH_URL, { reqheaders: { 'content-type': h => h.includes('multipart/related') } })
     .put('/db/docid')
     .reply(200, response)
 
-  // test POST /db
+  // test PUT /db/id
   const db = nano.db.use('db')
   const p = await db.multipart.insert(doc, images, { docName: 'docid' })
   expect(p).toStrictEqual(response)
@@ -87,7 +87,7 @@ test('should be able to handle 404 - db.multipart.insert', async () => {
     .put('/db/docid')
     .reply(404, response)
 
-  // test GET /db
+  // test PUT /db/id
   const db = nano.db.use('db')
   await expect(db.multipart.insert(doc, images, { docName: 'docid' })).rejects.toThrow('missing')
   expect(scope.isDone()).toBe(true)
diff --git a/test/nano.auth.test.js b/test/nano.auth.test.js
index fe6af9b..571b206 100644
--- a/test/nano.auth.test.js
+++ b/test/nano.auth.test.js
@@ -28,7 +28,7 @@ test('should be able to authenticate - POST /_session - nano.auth', async () =>
     .post('/_session', 'name=u&password=p', { 'content-type': 'application/x-www-form-urlencoded; charset=utf-8' })
     .reply(200, response, { 'Set-Cookie': 'AuthSession=YWRtaW46NUU0MTFBMDE6stHsxYnlDy4mYxwZEcnXHn4fm5w; Version=1; Expires=Mon, 10-Feb-2050 09:03:21 GMT; Max-Age=600; Path=/; HttpOnly' })
 
-  // test GET /_uuids
+  // test POST /_session
   const p = await nano.auth(username, password)
   expect(p).toStrictEqual(response)
   expect(scope.isDone()).toBe(true)
diff --git a/test/nano.logger.test.js b/test/nano.logger.test.js
index a6ae009..0c212e5 100644
--- a/test/nano.logger.test.js
+++ b/test/nano.logger.test.js
@@ -34,7 +34,7 @@ test('should be able to log output with user-defined function', async () => {
     .get('/db/id')
     .reply(200, response)
 
-  // test GET /db
+  // test GET /db/id
   const db = nano.db.use('db')
   const p = await db.get('id')
   expect(p).toStrictEqual(response)
diff --git a/test/nano.request.test.js b/test/nano.request.test.js
index 40b0e86..f0e7496 100644
--- a/test/nano.request.test.js
+++ b/test/nano.request.test.js
@@ -464,7 +464,7 @@ test('check request doesn\'t mangle bodies containing functions - nano.request',
     .post('/db', { a: 1, views: { bytime: { map: 'function () {\n          emit(doc.ts, true);\n        }' } } })
     .reply(200, response)
 
-  // test GET /db?a=1&b=2
+  // test POST /db
   const req = {
     method: 'post',
     db: 'db',
diff --git a/test/nano.session.test.js b/test/nano.session.test.js
index 2c0179a..7c3d1ee 100644
--- a/test/nano.session.test.js
+++ b/test/nano.session.test.js
@@ -26,7 +26,7 @@ test('should be able to check your session - GET /_session - nano.auth', async (
     .get('/_session')
     .reply(200, response)
 
-  // test GET /_uuids
+  // test GET /_session
   const p = await nano.session()
   expect(p).toStrictEqual(response)
   expect(scope.isDone()).toBe(true)
diff --git a/test/nano.updates.test.js b/test/nano.updates.test.js
index 23c9245..eca355b 100644
--- a/test/nano.updates.test.js
+++ b/test/nano.updates.test.js
@@ -49,7 +49,7 @@ test('should be able to fetch db updates - GET /_db_updates - nano.updates', asy
     .get('/_db_updates')
     .reply(200, response)
 
-  // test GET /db
+  // test GET /_db_updates
   const p = await nano.updates()
   expect(p).toStrictEqual(response)
   expect(scope.isDone()).toBe(true)
@@ -61,7 +61,7 @@ test('should be able to fetch db updates with options - GET /_db_updates - nano.
     .get('/_db_updates?timeout=10000')
     .reply(200, response)
 
-  // test GET /db
+  // test GET /_db_updates
   const p = await nano.updates({ timeout: 10000 })
   expect(p).toStrictEqual(response)
   expect(scope.isDone()).toBe(true)
@@ -73,7 +73,7 @@ test('should handle 404 - GET /_db_updates - nano.updates', async () => {
     .get('/_db_updates')
     .reply(404, errResponse)
 
-  // test GET /db
+  // test GET /_db_updates
   await expect(nano.db.updates()).rejects.toThrow('Database does not exist.')
   expect(scope.isDone()).toBe(true)
 })
diff --git a/test/notnocked.test.js b/test/notnocked.test.js
new file mode 100644
index 0000000..9350963
--- /dev/null
+++ b/test/notnocked.test.js
@@ -0,0 +1,111 @@
+// Licensed under the Apache License, Version 2.0 (the 'License'); you may not
+// use this file except in compliance with the License. You may obtain a copy of
+// the License at
+//
+//   http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an 'AS IS' BASIS, WITHOUT
+// WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
+// License for the specific language governing permissions and limitations under
+// the License.
+
+const Nano = require('..')
+const COUCH_URL = 'http://localhost:5984'
+const nano = Nano(COUCH_URL)
+const dbName = 'notnocked' + new Date().getTime()
+let db
+const emit = (k, v) => {
+  console.log(k, v)
+}
+
+test('should be able to create a database string', () => {
+  expect(typeof dbName).toBe('string')
+})
+
+// this section only runs if the TRAVIS environment variable is set.
+// It is set when running tests in TravisCI, where a CouchDB/Docker container
+// should be running. These non-mocked tests are not exhaustive, but serve
+// to demonstrate that the library does actually work with real CouchDB.
+if (process.env.TRAVIS) {
+  test('should be able to create a database - nano.db.create', async () => {
+    await nano.db.create(dbName)
+    db = nano.db.use(dbName, { n: 1 })
+  })
+
+  test('should be able to populate a database - nano.db.bulk', async () => {
+    const docs = [
+      { _id: 'crookshanks', name: 'Crookshanks', description: 'Hermione Granger\'s pet cat', year: 2004 },
+      { _id: 'felix', name: 'Felix', description: 'Cat from the silent film era', year: 1929 },
+      { _id: 'garfield', name: 'Garfield', description: 'Large orange cartoon cat', year: 1978 },
+      { _id: 'cheshirecat', name: 'Cheshire Cat', description: 'From Alice in Wonderland', year: 1865 },
+      { _id: 'snowbell', name: 'Snowbell', description: 'From Stuart Little', year: 1945 },
+      { _id: 'catinthehat', name: 'The Cat in the Hat', description: 'Tall cat with red and white striped hat and bow tie', year: 1957 },
+      { _id: 'dummy', name: 'to be deleted' }
+    ]
+    await db.bulk({ docs: docs })
+  })
+
+  test('should be able to get database info - nano.db.bulk', async () => {
+    const info = await db.info(dbName)
+    expect(info.doc_count).toBe(7)
+  })
+
+  test('should be able to delete a document', async () => {
+    const doc = await db.get('dummy')
+    await db.destroy('dummy', doc._rev)
+    const info = await db.info(dbName)
+    expect(info.doc_count).toBe(6)
+    expect(info.doc_del_count).toBe(1)
+  })
+
+  test('should be able to update a document', async () => {
+    const doc = await db.get('catinthehat')
+    doc.newfield = true
+    await db.insert(doc)
+    const info = await db.info(dbName)
+    expect(info.doc_count).toBe(6)
+  })
+
+  test('should be able to list documents in a database', async () => {
+    const data = await db.list({ limit: 1, descending: true })
+    expect(data.rows.length).toBe(1)
+    expect(data.rows[0].id).toBe('snowbell')
+  })
+
+  test('should be able to create a view', async () => {
+    const f = function (doc) {
+      emit(doc.year, doc.name)
+    }
+    const doc = {
+      views: {
+        byYear: {
+          map: f.toString(),
+          reduce: '_count'
+        }
+      }
+    }
+    await db.insert(doc, '_design/views')
+  })
+
+  test('should be able to query a view', async () => {
+    const data = await db.view('views', 'byYear', { reduce: false })
+    const response = {
+      total_rows: 6,
+      offset: 0,
+      rows: [
+        { id: 'cheshirecat', key: 1865, value: 'Cheshire Cat' },
+        { id: 'felix', key: 1929, value: 'Felix' },
+        { id: 'snowbell', key: 1945, value: 'Snowbell' },
+        { id: 'catinthehat', key: 1957, value: 'The Cat in the Hat' },
+        { id: 'garfield', key: 1978, value: 'Garfield' },
+        { id: 'crookshanks', key: 2004, value: 'Crookshanks' }
+      ]
+    }
+    expect(response).toStrictEqual(data)
+  })
+
+  test('should be able to destroy a database - nano.db.destroy', async () => {
+    await nano.db.destroy(dbName)
+  })
+}
diff --git a/test/partition.find.test.js b/test/partition.find.test.js
index 325758a..806f947 100644
--- a/test/partition.find.test.js
+++ b/test/partition.find.test.js
@@ -42,7 +42,7 @@ test('should be able to query a partitioned index - POST /db/_partition/partitio
     .post('/db/_partition/partition/_find', query)
     .reply(200, response)
 
-  // test POST /db/_find
+  // test POST /db/_partition/partition/_find
   const db = nano.db.use('db')
   const p = await db.partitionedFind('partition', query)
   expect(p).toStrictEqual(response)
@@ -64,7 +64,7 @@ test('should handle 404 - POST /db/_partition/partition/_find - db.partitionedFi
     .post('/db/_partition/partition/_find', query)
     .reply(404, response)
 
-  // test POST /db/_find
+  // test POST /db/_partition/partition/_find
   const db = nano.db.use('db')
   await expect(db.partitionedFind('partition', query)).rejects.toThrow('missing')
   expect(scope.isDone()).toBe(true)
diff --git a/test/partition.findAsStream.test.js b/test/partition.findAsStream.test.js
index 340eadf..9e53c90 100644
--- a/test/partition.findAsStream.test.js
+++ b/test/partition.findAsStream.test.js
@@ -43,7 +43,7 @@ test('should get a queried streamed list of documents from a partition- POST /db
     .reply(200, response)
 
   return new Promise((resolve, reject) => {
-    // test GET /db/_all_docs
+    // test /db/_partition/partition/_find
     const db = nano.db.use('db')
     const s = db.partitionedFindAsStream('partition', query)
     expect(typeof s).toBe('object')
diff --git a/test/partition.info.test.js b/test/partition.info.test.js
index 52c6670..2d9e8f5 100644
--- a/test/partition.info.test.js
+++ b/test/partition.info.test.js
@@ -36,7 +36,7 @@ test('should be able to fetch partition info info - GET /db/_partition/partition
     .get('/db/_partition/partition')
     .reply(200, response)
 
-  // test GET /db
+  // test GET /db/_partition/partition
   const p = await db.partitionInfo('partition')
   expect(p).toStrictEqual(response)
   expect(scope.isDone()).toBe(true)
@@ -48,7 +48,7 @@ test('should be able to fetch partition info info (callback) - GET /db/_partitio
     .get('/db/_partition/partition')
     .reply(200, response)
 
-  // test GET /db
+  // test GET /db/_partition/partition
   return new Promise((resolve, reject) => {
     db.partitionInfo('partition', (err, data) => {
       expect(err).toBeNull()
@@ -68,7 +68,7 @@ test('should handle missing database - PUT /db - nano.db.create', async () => {
       reason: 'Database does not exist.'
     })
 
-  // test GET /db
+  // test GET /db/_partition/partition
   await expect(db.partitionInfo('partition')).rejects.toThrow('Database does not exist')
   expect(scope.isDone()).toBe(true)
 })
diff --git a/test/partition.list.test.js b/test/partition.list.test.js
index c1b0e04..2d1035a 100644
--- a/test/partition.list.test.js
+++ b/test/partition.list.test.js
@@ -67,7 +67,7 @@ test('should be list documents form a partition - GET /db/_partition/_all_docs -
     .get('/db/_partition/partition/_all_docs')
     .reply(200, response)
 
-  // test GET /db
+  // test GET /db/_partition/_all_docs
   const p = await db.partitionedList('partition')
   expect(p).toStrictEqual(response)
   expect(scope.isDone()).toBe(true)
@@ -98,7 +98,7 @@ test('should be list documents form a partition with opts - GET /db/_partition/_
     .get('/db/_partition/partition/_all_docs?limit=1&include_docs=true')
     .reply(200, optsResponse)
 
-  // test GET /db
+  // test GET /db/_partition/_all_docs
   const p = await db.partitionedList('partition', { limit: 1, include_docs: true })
   expect(p).toStrictEqual(optsResponse)
   expect(scope.isDone()).toBe(true)
@@ -110,7 +110,7 @@ test('should be able to list partition docs (callback) - GET /db/_partition/_all
     .get('/db/_partition/partition/_all_docs')
     .reply(200, response)
 
-  // test GET /db
+  // test GET /db/_partition/_all_docs
   return new Promise((resolve, reject) => {
     db.partitionedList('partition', (err, data) => {
       expect(err).toBeNull()
@@ -130,7 +130,7 @@ test('should handle missing database - GET /db/_partition/_all_docs - db.partiti
       reason: 'Database does not exist.'
     })
 
-  // test GET /db
+  // test GET /db/_partition/_all_docs
   await expect(db.partitionedList('partition')).rejects.toThrow('Database does not exist')
   expect(scope.isDone()).toBe(true)
 })
diff --git a/test/partition.listAsStream.test.js b/test/partition.listAsStream.test.js
index f360cb2..b45c5be 100644
--- a/test/partition.listAsStream.test.js
+++ b/test/partition.listAsStream.test.js
@@ -53,7 +53,7 @@ test('should get a streamed list of documents from a partition- GET /db/_partiti
     .reply(200, response)
 
   return new Promise((resolve, reject) => {
-    // test GET /db/_all_docs
+    // test GET /db/_partition/_all_docs
     const db = nano.db.use('db')
     const s = db.partitionedListAsStream('partition')
     expect(typeof s).toBe('object')
@@ -95,7 +95,7 @@ test('should get a streamed list of documents from a partition with opts- GET /d
     .reply(200, response)
 
   return new Promise((resolve, reject) => {
-    // test GET /db/_all_docs
+    // test GET /db/_partition/_all_docs
     const db = nano.db.use('db')
     const s = db.partitionedListAsStream('partition', { limit: 1, include_docs: true })
     expect(typeof s).toBe('object')
diff --git a/test/partition.search.test.js b/test/partition.search.test.js
index 9f470fb..a54ed36 100644
--- a/test/partition.search.test.js
+++ b/test/partition.search.test.js
@@ -19,7 +19,7 @@ afterEach(() => {
   nock.cleanAll()
 })
 
-test('should be able to access a partitioned search index - POST /db/_partition/partition/_design/ddoc/_search/searchname - db.partitionedSearch', async () => {
+test('should be able to access a partitioned search index - GET /db/_partition/partition/_design/ddoc/_search/searchname - db.partitionedSearch', async () => {
   // mocks
   const response = {
     total_rows: 100000,
@@ -33,7 +33,7 @@ test('should be able to access a partitioned search index - POST /db/_partition/
     .get('/db/_partition/partition/_design/ddoc/_search/searchname?q=*:*')
     .reply(200, response)
 
-  // test GET /db
+  // test GET /db/_partition/partition/_design/ddoc/_search/searchname
   const db = nano.db.use('db')
   const p = await db.partitionedSearch('partition', 'ddoc', 'searchname', params)
   expect(p).toStrictEqual(response)
@@ -51,7 +51,7 @@ test('should be able to handle 404 - db.partitionedSearch', async () => {
     .get('/db/_partition/partition/_design/ddoc/_search/searchname?q=*:*')
     .reply(404, response)
 
-  // test GET /db
+  // test GET /db/_partition/partition/_design/ddoc/_search/searchname
   const db = nano.db.use('db')
   await expect(db.partitionedSearch('partition', 'ddoc', 'searchname', params)).rejects.toThrow('missing')
   expect(scope.isDone()).toBe(true)
diff --git a/test/partition.searchAsStream.test.js b/test/partition.searchAsStream.test.js
index 73faabd..ec90bc0 100644
--- a/test/partition.searchAsStream.test.js
+++ b/test/partition.searchAsStream.test.js
@@ -34,7 +34,7 @@ test('should get a searched streamed list of documents from a partition- GET /db
     .reply(200, response)
 
   return new Promise((resolve, reject) => {
-    // test GET /db/_all_docs
+    // test GET /db/_partition/partition/_design/ddoc/_search/searchname
     const db = nano.db.use('db')
     const s = db.partitionedSearchAsStream('partition', 'ddoc', 'searchname', params)
     expect(typeof s).toBe('object')
diff --git a/test/partition.view.test.js b/test/partition.view.test.js
index 7338fcb..4b532fd 100644
--- a/test/partition.view.test.js
+++ b/test/partition.view.test.js
@@ -30,7 +30,7 @@ test('should be able to access a partitioned view index - GET /db/_partition/par
     .get('/db/_partition/partition/_design/ddoc/_view/viewname')
     .reply(200, response)
 
-  // test GET /db
+  // test GET /db/_partition/partition/_design/ddoc/_view/viewname
   const db = nano.db.use('db')
   const p = await db.partitionedView('partition', 'ddoc', 'viewname')
   expect(p).toStrictEqual(response)
@@ -54,7 +54,7 @@ test('should be able to access a partitioned view index with opts - GET /db/_par
     .get('/db/_partition/partition/_design/ddoc/_view/viewname?reduce=false&startkey=%22a%22&endkey=%22b%22&limit=1')
     .reply(200, response)
 
-  // test GET /db
+  // test GET /db/_partition/partition/_design/ddoc/_view/viewname
   const db = nano.db.use('db')
   const p = await db.partitionedView('partition', 'ddoc', 'viewname', params)
   expect(p).toStrictEqual(response)
@@ -71,7 +71,7 @@ test('should be able to handle 404 - db.partitionedView', async () => {
     .get('/db/_partition/partition/_design/ddoc/_view/viewname')
     .reply(404, response)
 
-  // test GET /db
+  // test GET /db/_partition/partition/_design/ddoc/_view/viewname
   const db = nano.db.use('db')
   await expect(db.partitionedView('partition', 'ddoc', 'viewname')).rejects.toThrow('missing')
   expect(scope.isDone()).toBe(true)
diff --git a/test/partition.viewAsStream.test.js b/test/partition.viewAsStream.test.js
index 24a899f..97663db 100644
--- a/test/partition.viewAsStream.test.js
+++ b/test/partition.viewAsStream.test.js
@@ -19,7 +19,7 @@ afterEach(() => {
   nock.cleanAll()
 })
 
-test('should get a streamed list of documents from a view from  partition- GET /db/_partition/partition/_design/ddoc/_view/viewname - db.partitionedViewAsStream', async () => {
+test('should get a streamed list of documents from a view from  partition - GET /db/_partition/partition/_design/ddoc/_view/viewname - db.partitionedViewAsStream', async () => {
   // mocks
   const response = {
     rows: [
@@ -37,7 +37,7 @@ test('should get a streamed list of documents from a view from  partition- GET /
     .reply(200, response)
 
   return new Promise((resolve, reject) => {
-    // test GET /db/_all_docs
+    // test GET /db/_partition/partition/_design/ddoc/_view/viewnameGET /db/_all_docs
     const db = nano.db.use('db')
     const s = db.partitionedViewAsStream('partition', 'ddoc', 'viewname', params)
     expect(typeof s).toBe('object')