Skip to content

Commit f0ec5e4

Browse files
authored
Merge pull request #490 from mamoonraja/master
Update Discovery [semver minor]
2 parents c32ea78 + 55754b3 commit f0ec5e4

3 files changed

Lines changed: 17 additions & 4 deletions

File tree

discovery/v1.js

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ function DiscoveryV1(options) {
3232

3333
// Check if 'version_date' was provided
3434
if (typeof this._options.version_date === 'undefined') {
35-
throw new Error('Argument error: version_date was not specified, use DiscoveryV1.VERSION_DATE_2017_04_27');
35+
throw new Error('Argument error: version_date was not specified, use DiscoveryV1.VERSION_DATE_2017_08_01');
3636
}
3737
this._options.qs.version = options.version_date;
3838
}
@@ -52,6 +52,11 @@ DiscoveryV1.VERSION_DATE_2016_12_15 = '2016-12-15';
5252
* @type {string}
5353
*/
5454
DiscoveryV1.VERSION_DATE_2017_04_27 = '2017-04-27';
55+
/**
56+
* Release migrating from Watson Discovery News Original to Watson Discovery News
57+
* @type {string}
58+
*/
59+
DiscoveryV1.VERSION_DATE_2017_08_01 = '2017-08-01';
5560

5661
/**
5762
* Return the list of environments
@@ -285,7 +290,7 @@ DiscoveryV1.prototype.getConfiguration = function(params, callback) {
285290
*
286291
* @param {Object} params
287292
* @param {String} params.environment_id
288-
*/
293+
*/
289294
DiscoveryV1.prototype.getCollections = function(params, callback) {
290295
params = params || {};
291296

speech-to-text/recognize_stream.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -217,7 +217,7 @@ RecognizeStream.prototype.initialize = function() {
217217
this.initialized = true;
218218
};
219219

220-
RecognizeStream.prototype._read = function(/* size*/) {
220+
RecognizeStream.prototype._read = function() /* size*/ {
221221
// there's no easy way to control reads from the underlying library
222222
// so, the best we can do here is a no-op
223223
};

test/unit/test.discovery.v1.js

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,14 @@ describe('discovery-v1', function() {
1313

1414
// Test params
1515
const service = {
16+
username: 'batman',
17+
password: 'bruce-wayne',
18+
url: 'http://ibm.com:80',
19+
version: 'v1',
20+
version_date: DiscoveryV1.VERSION_DATE_2017_08_01
21+
};
22+
23+
const service_v2016_04_27 = {
1624
username: 'batman',
1725
password: 'bruce-wayne',
1826
url: 'http://ibm.com:80',
@@ -57,7 +65,7 @@ describe('discovery-v1', function() {
5765
});
5866

5967
describe('discovery versions', function() {
60-
[service, service_v2016_12_15].forEach(service => {
68+
[service, service_v2016_04_27, service_v2016_12_15].forEach(service => {
6169
beforeEach(function() {
6270
nock.disableNetConnect();
6371
// grr! these should be in the individual tests where they are needed!

0 commit comments

Comments
 (0)