Skip to content

Commit

Permalink
Fix lint.
Browse files Browse the repository at this point in the history
  • Loading branch information
lukesneeringer committed Apr 11, 2017
1 parent e1e5441 commit 1848364
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 7 deletions.
8 changes: 5 additions & 3 deletions packages/language/src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ var v1beta2 = require('./v1beta2');
var _GAPICS = {
v1: v1,
v1beta2: v1beta2
}
};

/**
* @type {module:language/document}
Expand All @@ -56,18 +56,20 @@ var Document = require('./document.js');
* @resource [Cloud Natural Language API Documentation]{@link https://cloud.google.com/natural-language/docs}
*
* @param {object} options - [Configuration object](#/docs).
* @param {string} options.apiVersion - API version. Defaults to "v1";
* the only other valid value is "v1beta2".
*/
function Language(options) {
if (!(this instanceof Language)) {
options = common.util.normalizeArguments(this, options);
return new Language(options);
}

options = extend({}, options, {
libName: 'gccl',
libVersion: require('../package.json').version
});

// Determine the version to be used.
// We default to "v1", but use "v1beta2" if explicitly requested. Both
// GAPICs are packaged with the library.
Expand Down
8 changes: 4 additions & 4 deletions packages/language/test/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -68,21 +68,21 @@ describe('Language', function() {
fakeV1Override = null;
language = new Language(OPTIONS);
});

describe('instantiation', function() {
it('should promisify all the things', function() {
assert(promisified);
});

it('should accept an apiVersion "v1beta2"', function() {
var RealLanguage = require('../src/index.js');

// The v1beta2 GAPIC adds a new `analyzeEntitySentiment` function.
var langBeta = new RealLanguage({apiVersion: 'v1beta2'});
assert.strictEqual(typeof langBeta.api.Language.analyzeEntitySentiment,
'function');
});

it('should not accept an unrecognized version', function() {
assert.throws(function() {
new Language({apiVersion: 'v1beta42'});
Expand Down

0 comments on commit 1848364

Please sign in to comment.