Skip to content
This repository was archived by the owner on Mar 11, 2022. It is now read-only.

Commit ab3dd55

Browse files
committed
Allowed for custom URL for test server
Set SERVER value from SERVER_URL and instantiate using `url: SERVER` instead of `account: ME` where applicable.
1 parent cfd24b0 commit ab3dd55

File tree

14 files changed

+69
-59
lines changed

14 files changed

+69
-59
lines changed

CONTRIBUTING.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,3 +49,11 @@ You can add verbose debug messages while running tests by doing:
4949
```
5050
DEBUG=* npm test
5151
```
52+
53+
### Test configuration
54+
55+
When testing with a real server (i.e. `NOCK_OFF=true`) these options are
56+
available to set as environment variables:
57+
`cloudant_username` - username
58+
`cloudant_password` - password
59+
`SERVER_URL` - the URL to use (defaults to `https://$cloudant_user.cloudant.com`)

soak_tests/soak.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ const uuidv4 = require('uuid/v4'); // random
2222

2323
const USER = process.env.cloudant_username || 'nodejs';
2424
const PASSWORD = process.env.cloudant_password || 'sjedon';
25-
const SERVER = `https://${USER}:${PASSWORD}@${USER}.cloudant.com`;
25+
const SERVER = process.env.SERVER_URL || `https://${USER}:${PASSWORD}@${USER}.cloudant.com`;
2626

2727
const MAX_RUNS = parseInt(process.env.max_runs, 10) || 100;
2828
const CONCURRENCY = parseInt(process.env.concurrency, 10) || 1;

test/client.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ const uuidv4 = require('uuid/v4'); // random
2424

2525
const ME = process.env.cloudant_username || 'nodejs';
2626
const PASSWORD = process.env.cloudant_password || 'sjedon';
27-
const SERVER = `https://${ME}.cloudant.com`;
27+
const SERVER = process.env.SERVER_URL || `https://${ME}.cloudant.com`;
2828
const DBNAME = `/nodejs-cloudant-${uuidv4()}`;
2929
const DOCID = 'doc1';
3030

test/clientutils.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ const testPlugin = require('./fixtures/testplugins.js');
2323
const utils = require('../lib/clientutils.js');
2424

2525
const ME = process.env.cloudant_username || 'nodejs';
26-
const SERVER = `https://${ME}.cloudant.com`;
26+
const SERVER = process.env.SERVER_URL || `https://${ME}.cloudant.com`;
2727

2828
describe('Client Utilities', function() {
2929
afterEach(function() {

test/cloudant.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ const uuidv4 = require('uuid/v4'); // random
2323

2424
const ME = process.env.cloudant_username || 'nodejs';
2525
const PASSWORD = process.env.cloudant_password || 'sjedon';
26-
const SERVER = `https://${ME}.cloudant.com`;
26+
const SERVER = process.env.SERVER_URL || `https://${ME}.cloudant.com`;
2727
const DBNAME = `nodejs-cloudant-${uuidv4()}`;
2828

2929
describe('Cloudant', function() {
@@ -77,7 +77,7 @@ describe('Cloudant', function() {
7777
.get(`/_api/v2/db/${DBNAME}/_security`)
7878
.reply(200, security);
7979

80-
var cloudant = Cloudant({ account: ME, password: PASSWORD });
80+
var cloudant = Cloudant({ url: SERVER, username: ME, password: PASSWORD });
8181
var db = cloudant.db.use(DBNAME);
8282

8383
db.set_security(security, function(err, result) {
@@ -103,7 +103,7 @@ describe('Cloudant', function() {
103103
.get(`/_api/v2/db/${DBNAME}/_security`)
104104
.reply(200, security);
105105

106-
var cloudant = Cloudant({ account: ME, password: PASSWORD });
106+
var cloudant = Cloudant({ url: SERVER, username: ME, password: PASSWORD });
107107
var db = cloudant.db.use(DBNAME);
108108

109109
db.set_security(role, function(err, result) {
@@ -138,7 +138,7 @@ describe('Cloudant', function() {
138138
.get(`/_api/v2/db/${DBNAME}/_security`)
139139
.reply(200, security);
140140

141-
var cloudant = Cloudant({ account: ME, password: PASSWORD });
141+
var cloudant = Cloudant({ url: SERVER, username: ME, password: PASSWORD });
142142
var db = cloudant.db.use(DBNAME);
143143

144144
db.set_security(security, function(err, result) {

test/fixtures/testplugins.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// Copyright © 2017 IBM Corp. All rights reserved.
1+
// Copyright © 2017, 2018 IBM Corp. All rights reserved.
22
//
33
// Licensed under the Apache License, Version 2.0 (the "License");
44
// you may not use this file except in compliance with the License.
@@ -17,7 +17,7 @@ const assert = require('assert');
1717
const BasePlugin = require('../../plugins/base.js');
1818

1919
const ME = process.env.cloudant_username || 'nodejs';
20-
const SERVER = `https://${ME}.cloudant.com`;
20+
const SERVER = process.env.SERVER_URL || `https://${ME}.cloudant.com`;
2121

2222
// NoopPlugin for testing
2323

test/issues/292.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ const uuidv4 = require('uuid/v4'); // random
2323

2424
const ME = process.env.cloudant_username || 'nodejs';
2525
const PASSWORD = process.env.cloudant_password || 'sjedon';
26-
const SERVER = `https://${ME}.cloudant.com`;
26+
const SERVER = process.env.SERVER_URL || `https://${ME}.cloudant.com`;
2727
const DBNAME = `nodejs-cloudant-${uuidv4()}`;
2828

2929
describe('Issue #292', function() {
@@ -72,7 +72,7 @@ describe('Issue #292', function() {
7272
.get(`/${DBNAME}/_index`)
7373
.reply(200, { total_rows: 1, indexes: [ { name: '_all_docs' } ] });
7474

75-
var cloudant = Cloudant({ account: ME, password: PASSWORD, plugins: 'promises' });
75+
var cloudant = Cloudant({ url: SERVER, username: ME, password: PASSWORD, plugins: 'promises' });
7676
var db = cloudant.db.use(DBNAME);
7777

7878
db.index().then((d) => {
@@ -94,7 +94,7 @@ describe('Issue #292', function() {
9494
.post(`/${DBNAME}/_index`, definition)
9595
.reply(200, { result: 'created' });
9696

97-
var cloudant = Cloudant({ account: ME, password: PASSWORD, plugins: 'promises' });
97+
var cloudant = Cloudant({ url: SERVER, username: ME, password: PASSWORD, plugins: 'promises' });
9898
var db = cloudant.db.use(DBNAME);
9999

100100
db.index(definition).then((d) => {

test/legacy/api.js

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ var Cloudant = require('../../cloudant.js');
2828
// These globals may potentially be parameterized.
2929
var ME = process.env.cloudant_username || 'nodejs';
3030
var PASSWORD = process.env.cloudant_password || 'sjedon';
31-
var SERVER = 'https://' + ME + '.cloudant.com';
31+
var SERVER = process.env.SERVER_URL || 'https://' + ME + '.cloudant.com';
3232
var mydb = null;
3333
var cc = null;
3434
var ddoc = null;
@@ -55,7 +55,7 @@ describe('Initialization', function() {
5555
.post('/_session').reply(200, {ok: true})
5656
.get('/').reply(200, {couchdb: 'Welcome', version: '1.0.2'});
5757

58-
Cloudant({account: ME, username: ME, password: PASSWORD}, function(er, cloudant, body) {
58+
Cloudant({url: SERVER, username: ME, password: PASSWORD}, function(er, cloudant, body) {
5959
should(er).equal(null, 'No problem pinging Cloudant');
6060
cloudant.should.be.an.Object;
6161
body.should.be.an.Object;
@@ -89,7 +89,7 @@ describe('Initialization', function() {
8989
.post('/_session').reply(200, {ok: true, userCtx: {name: ME, roles: []}})
9090
.get('/').reply(200, {couchdb: 'Welcome', version: '1.0.2'});
9191

92-
Cloudant({account: ME, username: ME, password: PASSWORD}, function(er, cloudant, welcome) {
92+
Cloudant({url: SERVER, username: ME, password: PASSWORD}, function(er, cloudant, welcome) {
9393
should(er).equal(null, 'No problem pinging Cloudant');
9494
cloudant.should.be.an.Object;
9595

@@ -115,7 +115,7 @@ describe('Authentication', function() {
115115
var mocks = nock(SERVER)
116116
.post('/_api/v2/api_keys').reply(200, { 'password': 'Eivln4jPiLS8BoTxjXjVukDT', 'ok': true, 'key': 'thandoodstrenterprourete' });
117117

118-
var c = Cloudant({account: ME, password: PASSWORD, plugins: 'retry'});
118+
var c = Cloudant({url: SERVER, username: ME, password: PASSWORD, plugins: 'retry'});
119119
c.generate_api_key(function(er, d) {
120120
should(er).equal(null);
121121
d.should.be.an.Object;
@@ -137,7 +137,7 @@ describe('CORS', function() {
137137
var mocks = nock(SERVER)
138138
.get('/_api/v2/user/config/cors').reply(200, { 'enable_cors': true, 'allow_credentials': true, 'origins': ['*']});
139139

140-
var c = Cloudant({account: ME, password: PASSWORD, plugins: 'retry'});
140+
var c = Cloudant({url: SERVER, username: ME, password: PASSWORD, plugins: 'retry'});
141141
c.get_cors(function(er, d) {
142142
should(er).equal(null);
143143
d.should.be.an.Object;
@@ -157,7 +157,7 @@ describe('CORS', function() {
157157
var mocks = nock(SERVER)
158158
.put('/_api/v2/user/config/cors').reply(200, { 'ok': true });
159159

160-
var c = Cloudant({account: ME, password: PASSWORD, plugins: 'retry'});
160+
var c = Cloudant({url: SERVER, username: ME, password: PASSWORD, plugins: 'retry'});
161161
c.set_cors({ 'enable_cors': true, 'allow_credentials': true, 'origins': ['*']}, function(er, d) {
162162
should(er).equal(null);
163163
d.should.be.an.Object;
@@ -179,7 +179,7 @@ describe('Authorization', function() {
179179
var mocks = nock(SERVER)
180180
.put('/' + dbName).reply(200, { 'ok': true });
181181

182-
cc = Cloudant({account: ME, password: PASSWORD, plugins: 'retry'});
182+
cc = Cloudant({url: SERVER, username: ME, password: PASSWORD, plugins: 'retry'});
183183
cc.db.create(dbName, function(er, d) {
184184
should(er).equal(null);
185185
d.should.be.an.Object;
@@ -248,7 +248,7 @@ describe('Cloudant-Specific APIs', function() {
248248
var mocks = nock(SERVER)
249249
.put('/' + dbName).reply(200, { 'ok': true });
250250

251-
cc = Cloudant({account: ME, password: PASSWORD, plugins: 'retry'});
251+
cc = Cloudant({url: SERVER, username: ME, password: PASSWORD, plugins: 'retry'});
252252
cc.db.create(dbName, function(er, d) {
253253
should(er).equal(null);
254254
d.should.be.an.Object;
@@ -358,7 +358,7 @@ describe('Changes query', function() {
358358
var mocks = nock(SERVER)
359359
.put('/' + dbName).reply(200, { 'ok': true });
360360

361-
cc = Cloudant({account: ME, password: PASSWORD, plugins: 'retry'});
361+
cc = Cloudant({ url: SERVER, username: ME, password: PASSWORD, plugins: 'retry' });
362362
cc.db.create(dbName, function(er, d) {
363363
should(er).equal(null);
364364
d.should.be.an.Object;
@@ -474,7 +474,7 @@ describe('Changes follower', function() {
474474
var mocks = nock(SERVER)
475475
.put('/' + dbName).reply(200, { 'ok': true });
476476

477-
cc = Cloudant({account: ME, password: PASSWORD, plugins: 'retry'});
477+
cc = Cloudant({ url: SERVER, username: ME, password: PASSWORD, plugins: 'retry' });
478478
cc.db.create(dbName, function(er, d) {
479479
should(er).equal(null);
480480
d.should.be.an.Object;
@@ -615,7 +615,7 @@ describe('Cloudant Query', function() {
615615
var mocks = nock(SERVER)
616616
.put('/' + dbName).reply(200, { 'ok': true });
617617

618-
cc = Cloudant({account: ME, password: PASSWORD, plugins: 'retry'});
618+
cc = Cloudant({ url: SERVER, username: ME, password: PASSWORD, plugins: 'retry' });
619619
cc.db.create(dbName, function(er, d) {
620620
should(er).equal(null);
621621
d.should.be.an.Object;
@@ -758,7 +758,7 @@ describe('Cloudant Search', function() {
758758
var mocks = nock(SERVER)
759759
.put('/' + dbName).reply(200, { 'ok': true });
760760

761-
cc = Cloudant({account: ME, password: PASSWORD, plugins: 'retry'});
761+
cc = Cloudant({ url: SERVER, username: ME, password: PASSWORD, plugins: 'retry' });
762762
cc.db.create(dbName, function(er, d) {
763763
should(er).equal(null);
764764
d.should.be.an.Object;
@@ -949,7 +949,7 @@ function test_gzip() {
949949
'content-type': 'text/css'
950950
});
951951

952-
var c = Cloudant({account: ME, password: PASSWORD, plugins: 'retry'});
952+
var c = Cloudant({ url: SERVER, username: ME, password: PASSWORD, plugins: 'retry' });
953953
var mydb = c.db.use(dbName);
954954
mydb.attachment.get('x', 'y.css', function(er, data) {
955955
should(er).equal(null);
@@ -970,7 +970,7 @@ describe('Virtual Hosts', function() {
970970
var mocks = nock(SERVER)
971971
.get('/_api/v2/user/virtual_hosts').reply(200, {'virtual_hosts': []});
972972

973-
var c = Cloudant({account: ME, password: PASSWORD, plugins: 'retry'});
973+
var c = Cloudant({ url: SERVER, username: ME, password: PASSWORD, plugins: 'retry' });
974974
c.get_virtual_hosts(function(er, d) {
975975
should(er).equal(null);
976976
d.should.be.an.Object;
@@ -986,7 +986,7 @@ describe('Virtual Hosts', function() {
986986
var mocks = nock(SERVER)
987987
.post('/_api/v2/user/virtual_hosts').reply(200, {'ok': true});
988988

989-
var c = Cloudant({account: ME, password: PASSWORD, plugins: 'retry'});
989+
var c = Cloudant({ url: SERVER, username: ME, password: PASSWORD, plugins: 'retry' });
990990
c.add_virtual_host({ host: myHost, path: '/mypath'}, function(er, d) {
991991
should(er).equal(null);
992992
d.should.be.an.Object;
@@ -1003,7 +1003,7 @@ describe('Virtual Hosts', function() {
10031003
var mocks = nock(SERVER)
10041004
.delete('/_api/v2/user/virtual_hosts').reply(200, { 'ok': true });
10051005

1006-
var c = Cloudant({account: ME, password: PASSWORD, plugins: 'retry'});
1006+
var c = Cloudant({ url: SERVER, username: ME, password: PASSWORD, plugins: 'retry' });
10071007
c.delete_virtual_host({ host: myHost, path: '/mypath'}, function(er, d) {
10081008
should(er).equal(null);
10091009
d.should.be.an.Object;

test/legacy/plugin.js

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ var PassThroughDuplex = require('../../lib/passthroughduplex.js');
3131
// These globals may potentially be parameterized.
3232
var ME = process.env.cloudant_username || 'nodejs';
3333
var PASSWORD = process.env.cloudant_password || 'sjedon';
34-
var SERVER = 'https://' + ME + '.cloudant.com';
34+
var SERVER = process.env.SERVER_URL || 'https://' + ME + '.cloudant.com';
3535
var dbName;
3636
var mydb = null;
3737
var cc = null;
@@ -47,7 +47,7 @@ var onBefore = function(done) {
4747
.put('/' + dbName).reply(200, { 'ok': true })
4848
.put('/' + dbName + '/mydoc').reply(200, { id: 'mydoc', rev: '1-1' });
4949

50-
cc = Cloudant({account: ME, password: PASSWORD, plugins: 'retry'});
50+
cc = Cloudant({url: SERVER, username: ME, password: PASSWORD, plugins: 'retry'});
5151
cc.db.create(dbName, function(er, d) {
5252
should(er).equal(null);
5353
d.should.be.an.Object;
@@ -93,7 +93,7 @@ describe('retry-on-429 plugin', function() {
9393
if (typeof(process.env.NOCK_OFF) === 'undefined') {
9494
mocks.persist().get('/' + dbName).reply(200, {});
9595
}
96-
var cloudant = Cloudant({plugins: 'retry', account: ME, password: PASSWORD});
96+
var cloudant = Cloudant({plugins: 'retry', url: SERVER, username: ME, password: PASSWORD});
9797
cloudant.cc._addPlugins('retry'); // retry socket hang up errors
9898
var db = cloudant.db.use(dbName);
9999
this.timeout(10000);
@@ -106,7 +106,7 @@ describe('retry-on-429 plugin', function() {
106106

107107
it('allow no callback', function(done) {
108108
var mocks = nock(SERVER).get('/' + dbName).reply(200, {});
109-
var cloudant = Cloudant({plugins: 'retry', account: ME, password: PASSWORD});
109+
var cloudant = Cloudant({plugins: 'retry', url: SERVER, username: ME, password: PASSWORD});
110110
var db = cloudant.db.use(dbName);
111111
this.timeout(10000);
112112
db.info();
@@ -116,7 +116,7 @@ describe('retry-on-429 plugin', function() {
116116
it('should return a stream', function(done) {
117117
var mocks = nock(SERVER)
118118
.get('/' + dbName).reply(200, { ok: true });
119-
var cloudant = Cloudant({plugins: 'retry', account: ME, password: PASSWORD});
119+
var cloudant = Cloudant({plugins: 'retry', url: SERVER, username: ME, password: PASSWORD});
120120
var db = cloudant.db.use(dbName);
121121
var p = db.info(function() {
122122
done();
@@ -132,7 +132,7 @@ describe('promise plugin', function() {
132132
it('should return a promise', function(done) {
133133
var mocks = nock(SERVER)
134134
.get('/' + dbName).reply(200, { ok: true });
135-
var cloudant = Cloudant({plugins: 'promises', account: ME, password: PASSWORD});
135+
var cloudant = Cloudant({plugins: 'promises', url: SERVER, username: ME, password: PASSWORD});
136136
var db = cloudant.db.use(dbName);
137137
var p = db.info().then(function(data) {
138138
data.should.be.an.Object;
@@ -144,7 +144,7 @@ describe('promise plugin', function() {
144144
it('should return an error status code', function(done) {
145145
var mocks = nock(SERVER)
146146
.get('/somedbthatdoesntexist').reply(404, { ok: false });
147-
var cloudant = Cloudant({plugins: 'promises', account: ME, password: PASSWORD});
147+
var cloudant = Cloudant({plugins: 'promises', url: SERVER, username: ME, password: PASSWORD});
148148
var db = cloudant.db.use('somedbthatdoesntexist');
149149
var p = db.info().then(function(data) {
150150
assert(false);
@@ -167,7 +167,7 @@ describe('cookieauth plugin', function() {
167167
var mocks = nock(SERVER)
168168
.post('/_session').reply(200, { ok: true })
169169
.get('/' + dbName).reply(200, { ok: true });
170-
var cloudant = Cloudant({plugins: 'cookieauth', account: ME, password: PASSWORD});
170+
var cloudant = Cloudant({plugins: 'cookieauth', url: SERVER, username: ME, password: PASSWORD});
171171
var db = cloudant.db.use(dbName);
172172
var p = db.info(function(err, data) {
173173
assert.equal(err, null);
@@ -183,7 +183,7 @@ describe('cookieauth plugin', function() {
183183
var mocks = nock(SERVER)
184184
.post('/_session', {name: ME, password: PASSWORD}).reply(200, { ok: true, info: {}, userCtx: { name: ME, roles: ['_admin'] } })
185185
.get('/' + dbName + '/mydoc').reply(200, { _id: 'mydoc', _rev: '1-123', ok: true });
186-
var cloudant = Cloudant({plugins: 'cookieauth', account: ME, password: PASSWORD});
186+
var cloudant = Cloudant({plugins: 'cookieauth', url: SERVER, username: ME, password: PASSWORD});
187187
var db = cloudant.db.use(dbName);
188188
var p = db.get('mydoc', function(err, data) {
189189
assert.equal(err, null);
@@ -204,7 +204,7 @@ describe('cookieauth plugin', function() {
204204
.reply(401, {error: 'unauthorized', reason: 'Name or password is incorrect.'})
205205
.get('/' + dbName + '/mydoc')
206206
.reply(401, {error: 'unauthorized', reason: 'Name or password is incorrect.'});
207-
var cloudant = Cloudant({plugins: 'cookieauth', account: ME, password: 'wrongpassword'});
207+
var cloudant = Cloudant({plugins: 'cookieauth', url: SERVER, username: ME, password: 'wrongpassword'});
208208
var db = cloudant.db.use(dbName);
209209
var p = db.get('mydoc', function(err, data) {
210210
assert.equal(data, null);
@@ -223,7 +223,7 @@ describe('cookieauth plugin', function() {
223223
.post('/_session', {name: ME, password: PASSWORD}).reply(200, { ok: true, info: {}, userCtx: { name: ME, roles: ['_admin'] } }, { 'Set-Cookie': 'AuthSession=xyz; Version=1; Path=/; HttpOnly' })
224224
.get('/' + dbName + '/mydoc').reply(200, { _id: 'mydoc', _rev: '1-123', ok: true })
225225
.get('/' + dbName + '/mydoc').reply(200, { _id: 'mydoc', _rev: '1-123', ok: true });
226-
var cloudant = Cloudant({plugins: 'cookieauth', account: ME, password: PASSWORD});
226+
var cloudant = Cloudant({plugins: 'cookieauth', url: SERVER, username: ME, password: PASSWORD});
227227
var db = cloudant.db.use(dbName);
228228
var p = db.get('mydoc', function(err, data) {
229229
assert.equal(err, null);
@@ -272,7 +272,7 @@ describe('cookieauth plugin', function() {
272272
.reply(401, {error: 'unauthorized', reason: 'Name or password is incorrect.'})
273273
.get('/')
274274
.reply(200, {couchdb: 'Welcome', version: '1.0.2', cloudant_build: '2488'});
275-
var cloudant = Cloudant({plugins: 'cookieauth', account: ME, password: PASSWORD}, function(err, cloudant, data) {
275+
var cloudant = Cloudant({plugins: 'cookieauth', url: SERVER, username: ME, password: PASSWORD}, function(err, cloudant, data) {
276276
cloudant.should.be.an.Object;
277277
data.should.be.an.Object.have.a.property('couchdb');
278278
mocks.done();
@@ -309,7 +309,7 @@ describe('custom plugin', function() {
309309
.get('/')
310310
.reply(200, { couchdb: 'Welcome', version: '1.0.2', cloudant_build: '2488' });
311311

312-
var cloudant = Cloudant({ plugins: defaultPlugin, account: ME, password: PASSWORD });
312+
var cloudant = Cloudant({ plugins: defaultPlugin, url: SERVER, username: ME, password: PASSWORD });
313313
cloudant.ping(function(err, data) {
314314
assert.equal(err, null);
315315
assert.equal(data.couchdb, 'Welcome');
@@ -339,7 +339,7 @@ describe('custom plugin', function() {
339339
.get('/')
340340
.reply(200, { couchdb: 'Welcome' });
341341

342-
Cloudant({ plugins: defaultPlugin, account: ME, password: PASSWORD }, function(err, nano, pong) {
342+
Cloudant({ plugins: defaultPlugin, url: SERVER, username: ME, password: PASSWORD }, function(err, nano, pong) {
343343
assert.equal(err, null);
344344
assert.notEqual(nano, null);
345345
assert.equal(pong.couchdb, 'Welcome');
@@ -357,7 +357,7 @@ describe('custom plugin', function() {
357357
.get('/')
358358
.reply(401, { error: 'unauthorized', reason: 'Name or password is incorrect.' });
359359

360-
Cloudant({ plugins: defaultPlugin, account: ME, password: badPass }, function(err, nano) {
360+
Cloudant({ plugins: defaultPlugin, url: SERVER, username: ME, password: badPass }, function(err, nano) {
361361
assert.equal(err.error, 'unauthorized');
362362
assert.equal(nano, null);
363363
mocks.done();

0 commit comments

Comments
 (0)