-
Notifications
You must be signed in to change notification settings - Fork 2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add remaining Translate samples. #197
Conversation
@@ -103,7 +104,7 @@ describe('translate:translate', function () { | |||
var error = new Error('error'); | |||
var sample = getSample(); | |||
var callback = sinon.stub(); | |||
sample.mocks.translate.getLanguages = sinon.stub().callsArgWith(0, error); | |||
sample.mocks.translate.getLanguages.yields(error); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nit: this should be in a separate PR - not that I care. 😛
Left a few comments. Fix those and it should be LGTM. |
Addressed comments. |
}); | ||
|
||
it('should list languages with a different target', function (done) { | ||
program.listLanguages('es', apiKey, function (err, languages) { | ||
assert.ifError(err); | ||
assert(Array.isArray(languages)); | ||
assert(languages.length > 0); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can/should we assert that the target is recognized here? e.g.
assert.equal(languages.contains("Espanol"), true);
Just a few minor nits - fix those and I'll LGTM. |
f840a08
to
eff41c3
Compare
Addressed comments. |
Current coverage is 89.17% (diff: 100%)@@ master #197 diff @@
==========================================
Files 57 57
Lines 2382 2392 +10
Methods 0 0
Messages 0 0
Branches 0 0
==========================================
+ Hits 2123 2133 +10
Misses 259 259
Partials 0 0
|
sinon.stub(program, 'detectLanguage'); | ||
program.main(['detect', text, '-k', apiKey]); | ||
assert.equal(program.detectLanguage.calledOnce, true); | ||
assert.deepEqual(program.detectLanguage.firstCall.args.slice(0, -1), [[text]]); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should this be setting an environment variable? If so, can we test that?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done.
LGTM, other than a few nits. |
Co-authored-by: release-please[bot] <55107282+release-please[bot]@users.noreply.github.com>
* updated CHANGELOG.md * updated package.json * updated samples/package.json
Co-authored-by: release-please[bot] <55107282+release-please[bot]@users.noreply.github.com>
Co-authored-by: release-please[bot] <55107282+release-please[bot]@users.noreply.github.com>
* updated CHANGELOG.md * updated package.json * updated samples/package.json
Co-authored-by: release-please[bot] <55107282+release-please[bot]@users.noreply.github.com>
* updated CHANGELOG.md * updated package.json * updated samples/package.json
* updated CHANGELOG.md * updated package.json * updated samples/package.json
* updated CHANGELOG.md * updated package.json * updated samples/package.json
* updated CHANGELOG.md * updated package.json * updated samples/package.json
* updated CHANGELOG.md * updated package.json * updated samples/package.json
* Fixed issues in some cases when user setting up environment. * fix: use bash trap Co-authored-by: Alexander Fenster <github@fenster.name>
No description provided.