Skip to content

Commit

Permalink
Fixed some linting errors.
Browse files Browse the repository at this point in the history
  • Loading branch information
mkulke committed May 12, 2014
1 parent ec5bc2d commit fcab714
Showing 1 changed file with 17 additions and 17 deletions.
34 changes: 17 additions & 17 deletions test/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ var tests = [{
dataTypeID: 1184,
actual: '2011-01-23 22:05:00.68-06',
expected: function(val) {
assert.UTCDate(val, 2011, 0, 24, 4, 5, 00, 680);
assert.UTCDate(val, 2011, 0, 24, 4, 5, 0, 680);
}
}, {
name: 'timestampz with huge miliseconds in UTC',
Expand Down Expand Up @@ -114,33 +114,33 @@ var tests = [{
dataTypeID: 1082,
actual: '2010-10-31',
expected: function(val) {
var now = new Date(2010, 9, 31)
var now = new Date(2010, 9, 31);
assert.UTCDate(val, 2010, now.getUTCMonth(), now.getUTCDate(), now.getUTCHours(), 0, 0, 0);
assert.equal(val.getHours(), now.getHours())
assert.equal(val.getHours(), now.getHours());
}
},{
name: 'interval time',
format: 'text',
dataTypeID: 1186,
actual: '01:02:03',
expected: function(val) {
assert.deepEqual(val, {'hours':1, 'minutes':2, 'seconds':3})
assert.deepEqual(val, {'hours':1, 'minutes':2, 'seconds':3});
}
},{
name: 'interval long',
format: 'text',
dataTypeID: 1186,
actual: '1 year -32 days',
expected: function(val) {
assert.deepEqual(val, {'years':1, 'days':-32})
assert.deepEqual(val, {'years':1, 'days':-32});
}
},{
name: 'interval combined negative',
format: 'text',
dataTypeID: 1186,
actual: '1 day -00:00:03',
expected: function(val) {
assert.deepEqual(val, {'days':1, 'seconds':-3})
assert.deepEqual(val, {'days':1, 'seconds':-3});
}
},{
name: 'bytea',
Expand Down Expand Up @@ -343,20 +343,20 @@ var assert = require('./assert');

describe('type parsing', function() {
tests.forEach(function(test) {
test.format = test.format || 'text'
test.format = test.format || 'text';
it('correctly parses ' + test.name + ' (' + test.format + ')', function() {
var parser = pgTypes.getTypeParser(test.dataTypeID, test.format)
var result = parser(test.actual)
var parser = pgTypes.getTypeParser(test.dataTypeID, test.format);
var result = parser(test.actual);
if(typeof test.expected == 'function') {
return test.expected(result)
return test.expected(result);
}
assert.strictEqual(result, test.expected)
})
})
})
assert.strictEqual(result, test.expected);
});
});
});

describe('interface', function() {
it('exports text parsers by default', function() {
assert.strictEqual(pgTypes.getTypeParser(23), pgTypes.getTypeParser(23, 'text'))
})
})
assert.strictEqual(pgTypes.getTypeParser(23), pgTypes.getTypeParser(23, 'text'));
});
});

0 comments on commit fcab714

Please sign in to comment.