diff --git a/package.json b/package.json index 291bc2acee..58a11cea47 100644 --- a/package.json +++ b/package.json @@ -13,7 +13,7 @@ "@types/bytebuffer": "^5.0.34", "bn.js": "^4.11.8", "bunyan": "^1.8.10", - "cloudant": "^1.10.0", + "@cloudant/cloudant": "^2.1.0", "del": "^2.2.2", "elliptic": "^6.3.2", "eslint": "^4.6.1", diff --git a/test/integration/couchdb-util.js b/test/integration/couchdb-util.js index 976f98d38a..2a1c2b376c 100644 --- a/test/integration/couchdb-util.js +++ b/test/integration/couchdb-util.js @@ -1,5 +1,5 @@ /** - * Copyright 2017 IBM All Rights Reserved. + * Copyright 2017, 2018 IBM All Rights Reserved. * * Licensed under the Apache License, Version 2.0 (the 'License'); * you may not use this file except in compliance with the License. @@ -16,7 +16,7 @@ var Client = require('fabric-client'); var nano = require('nano'); -var Cloudant = require('cloudant'); +var Cloudant = require('@cloudant/cloudant'); module.exports.getCloudantClient = function(configFile) { var username = Client.getConfigSetting('cloudant-username', 'notfound'); @@ -44,5 +44,3 @@ module.exports.destroy = function(name, url) { }); }); }; - - diff --git a/test/unit/couchdb-key-value-store.js b/test/unit/couchdb-key-value-store.js index f4a004eb37..4b344ecd84 100644 --- a/test/unit/couchdb-key-value-store.js +++ b/test/unit/couchdb-key-value-store.js @@ -42,15 +42,16 @@ test('\n\n** CouchDBKeyValueStore tests', (t) => { var store; - new CDBKVS({url: 'http://dummyUrl'}) + new CDBKVS({url: 'http://localhost:9999'}) .then(() => { - t.fail('Should not have been able to successfully constructed a store from an invalid URL'); - t.end(); - }).catch((err) => { - if (err.message && err.message.indexOf('Error: getaddrinfo ENOTFOUND dummyurl') > 0) { + t.fail('Should not have been able to successfully construct a store from an invalid URL'); + throw new Error('Failed'); + },(err) => { + if (err.message && err.message.indexOf('ECONNREFUSED') > 0) { t.pass('Successfully rejected the construction request due to invalid URL'); } else { t.fail('Store construction failed for unknown reason: ' + err.stack ? err.stack : err); + throw new Error('Failed'); } var couchdb = CouchdbMock.createServer(); @@ -87,4 +88,4 @@ test('\n\n** CouchDBKeyValueStore tests', (t) => { t.fail(err.stack ? err.stack : err); t.end(); }); -}); \ No newline at end of file +});