Skip to content
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

Introduce Natural Language API #1440

Merged
merged 11 commits into from
Aug 8, 2016
18 changes: 13 additions & 5 deletions packages/language/test/document.js
Original file line number Diff line number Diff line change
Expand Up @@ -287,7 +287,19 @@ describe('Document', function() {
Document.formatTokens_ = util.noop;
});

it('should return the language and syntax by default', function(done) {
it('should return the language by default', function(done) {
var apiResponse = apiResponses.default;
document.request = createRequestWithResponse(apiResponse);

document.annotate(function(err, annotation, apiResponse_) {
assert.ifError(err);
assert.strictEqual(annotation.language, apiResponse.language);
assert.deepEqual(apiResponse_, apiResponse);
done();
});
});

it('should return the syntax by default', function(done) {

This comment was marked as spam.

This comment was marked as spam.

This comment was marked as spam.

var apiResponse = apiResponses.default;
document.request = createRequestWithResponse(apiResponse);

Expand All @@ -307,13 +319,9 @@ describe('Document', function() {

document.annotate(function(err, annotation, apiResponse_) {
assert.ifError(err);

assert.strictEqual(annotation.language, apiResponse.language);
assert.strictEqual(annotation.sentences, formattedSentences);
assert.strictEqual(annotation.tokens, formattedTokens);

assert.deepEqual(apiResponse_, apiResponse);

done();
});
});
Expand Down