Fixing lint errors

This commit is contained in:
Ron Lloyd 2016-08-30 06:58:08 -06:00
parent a96d61fa9f
commit 980151d0a8
2 changed files with 33 additions and 34 deletions

View File

@ -338,14 +338,13 @@ describe('migrations', function() {
});
});
it('should map zero dateTime into null', function (done) {
it('should map zero dateTime into null', function(done) {
query('INSERT INTO `DateData` ' +
'(`dateTime`, `timestamp`) ' +
'VALUES("0000-00-00 00:00:00", "0000-00-00 00:00:00") ',
function (err, ret) {
function(err, ret) {
should.not.exists(err);
DateData.findById(ret.insertId, function (err, dateData) {
DateData.findById(ret.insertId, function(err, dateData) {
should(dateData.dateTime)
.be.null();
should(dateData.timestamp)

View File

@ -13,7 +13,7 @@ before(function() {
});
describe('MySQL connector', function() {
before(function () {
before(function() {
setupAltColNameData();
});
@ -168,32 +168,32 @@ describe('MySQL connector', function() {
});
function setupAltColNameData() {
var schema = {
"name": "ColRenameTest",
"options": {
"idInjection": false,
"mysql": {
"schema": "myapp_test",
"table": "col_rename_test"
}
},
"properties": {
"firstName": {
"type": "String",
"required": false,
"length": 40,
"mysql": {
"columnName": "first_name",
"dataType": "varchar",
"dataLength": 40
}
var schema = {
name: 'ColRenameTest',
options: {
idInjection: false,
mysql: {
schema: 'myapp_test',
table: 'col_rename_test',
},
"lastName": {
"type": "String",
"required": false,
"length": 40
}
}
},
properties: {
firstName: {
type: 'String',
required: false,
length: 40,
mysql: {
columnName: 'first_name',
dataType: 'varchar',
dataLength: 40,
},
},
lastName: {
type: 'String',
required: false,
length: 40,
},
},
};
ds.createModel(schema.name, schema.properties, schema.options);
}
@ -212,19 +212,19 @@ describe('MySQL connector', function() {
});
});
it('"mysql.columnName" is updated with correct name on create table', function (done) {
it('"mysql.columnName" is updated with correct name on create table', function(done) {
// first autoupdate call uses create table
verifyMysqlColumnNameAutoupdate(done);
});
it('"mysql.columnName" is updated without changing column name on alter table', function (done) {
it('"mysql.columnName" is updated without changing column name on alter table', function(done) {
// second autoupdate call uses alter table
verifyMysqlColumnNameAutoupdate(done);
});
function verifyMysqlColumnNameAutoupdate(done) {
ds.autoupdate('ColRenameTest', function (err) {
ds.discoverModelProperties('col_rename_test', function (err, props) {
ds.autoupdate('ColRenameTest', function(err) {
ds.discoverModelProperties('col_rename_test', function(err, props) {
assert.equal(props[0].columnName, 'first_name');
assert.equal(props[1].columnName, 'lastName');
assert.equal(props.length, 2);