Skip to content

Commit

Permalink
FAB-8826 NodeSDK Update cloudant ver
Browse files Browse the repository at this point in the history
Update cloudant version and package name.
cloudant is now @cloudant/cloudant v2.1.0

Change-Id: I94edf329f758fde985a06160aa54ece67ddc3fbb
Signed-off-by: Bret Harrison <[email protected]>
  • Loading branch information
harrisob committed Mar 13, 2018
1 parent 55e4f5b commit 9ad4356
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 11 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
6 changes: 2 additions & 4 deletions test/integration/couchdb-util.js
Original file line number Diff line number Diff line change
@@ -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.
Expand All @@ -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');
Expand Down Expand Up @@ -44,5 +44,3 @@ module.exports.destroy = function(name, url) {
});
});
};


13 changes: 7 additions & 6 deletions test/unit/couchdb-key-value-store.js
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down Expand Up @@ -87,4 +88,4 @@ test('\n\n** CouchDBKeyValueStore tests', (t) => {
t.fail(err.stack ? err.stack : err);
t.end();
});
});
});

0 comments on commit 9ad4356

Please sign in to comment.