Adds failing test for timezones behind GMT

This commit is contained in:
romellem 2017-10-09 09:24:31 -05:00
parent 2059fd422a
commit ea43094ed6

View file

@ -400,14 +400,24 @@ describe('DiffParser', function() {
}); });
it('should parse unified non git diff and strip timestamps off the headers', function() { it('should parse unified non git diff and strip timestamps off the headers', function() {
var diff = var diffs = [
// 2 hours ahead of GMT
'--- a/sample.js 2016-10-25 11:37:14.000000000 +0200\n' + '--- a/sample.js 2016-10-25 11:37:14.000000000 +0200\n' +
'+++ b/sample.js 2016-10-25 11:37:14.000000000 +0200\n' + '+++ b/sample.js 2016-10-25 11:37:14.000000000 +0200\n' +
'@@ -1 +1,2 @@\n' + '@@ -1 +1,2 @@\n' +
'-test\n' + '-test\n' +
'+test1r\n' + '+test1r\n' +
'+test2r\n'; '+test2r\n',
// 2 hours behind GMT
'--- a/sample.js 2016-10-25 11:37:14.000000000 -0200\n' +
'+++ b/sample.js 2016-10-25 11:37:14.000000000 -0200\n' +
'@@ -1 +1,2 @@\n' +
'-test\n' +
'+test1r\n' +
'+test2r\n'
];
diffs.forEach(function(diff) {
var result = DiffParser.generateDiffJson(diff); var result = DiffParser.generateDiffJson(diff);
var file1 = result[0]; var file1 = result[0];
assert.equal(1, result.length); assert.equal(1, result.length);
@ -423,6 +433,9 @@ describe('DiffParser', function() {
assert.deepEqual(linesContent, ['-test', '+test1r', '+test2r']); assert.deepEqual(linesContent, ['-test', '+test1r', '+test2r']);
}); });
});
it('should parse unified non git diff', function() { it('should parse unified non git diff', function() {
var diff = var diff =
'--- a/sample.js\n' + '--- a/sample.js\n' +