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

normalize new lines for Vision test #1252

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -140,6 +140,7 @@
"mockery-next": "^2.0.1-3",
"multiline": "^1.0.2",
"node-uuid": "^1.4.3",
"normalize-newline": "^2.0.0",
"tmp": "0.0.27"
},
"scripts": {
Expand Down
6 changes: 4 additions & 2 deletions system-test/storage.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ var assert = require('assert');
var async = require('async');
var crypto = require('crypto');
var fs = require('fs');
var normalizeNewline = require('normalize-newline');
var prop = require('propprop');
var request = require('request');
var through = require('through2');
Expand Down Expand Up @@ -569,8 +570,9 @@ describe('storage', function() {
}
};

var expectedContents = fs.readFileSync(FILES.html.path, 'utf-8')
.replace(/\r\n/g, '\n'); // Normalize line endings.
var expectedContents = normalizeNewline(
fs.readFileSync(FILES.html.path, 'utf-8')
);

bucket.upload(FILES.gzip.path, options, function(err, file) {
assert.ifError(err);
Expand Down
5 changes: 3 additions & 2 deletions system-test/vision.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
var assert = require('assert');
var is = require('is');
var multiline = require('multiline');
var normalizeNewline = require('normalize-newline');
var path = require('path');

var env = require('./env.js');
Expand Down Expand Up @@ -311,12 +312,12 @@ describe('Vision', function() {

describe('text', function() {
var expectedResults = [
multiline.stripIndent(function() {/*
normalizeNewline(multiline.stripIndent(function() {/*
Google Cloud Client Library for Node.js an idiomatic, intuitive, and
natural way for Node.js developers to integrate with Google Cloud
Platform services, like Cloud Datastore and Cloud Storage.

*/})
*/}))
];

expectedResults = expectedResults.concat(
Expand Down