Merge pull request #1114 from strongloop/feature/upgrade-jscs
Upgrade jscs to ~1.11 via grunt-jscs ^1.5
This commit is contained in:
commit
6276773c0b
|
@ -423,8 +423,8 @@ module.exports = function(Change) {
|
||||||
var checkpointModel = this.Checkpoint;
|
var checkpointModel = this.Checkpoint;
|
||||||
if (checkpointModel) return checkpointModel;
|
if (checkpointModel) return checkpointModel;
|
||||||
this.Checkpoint = checkpointModel = loopback.Checkpoint.extend('checkpoint');
|
this.Checkpoint = checkpointModel = loopback.Checkpoint.extend('checkpoint');
|
||||||
assert(this.dataSource, 'Cannot getCheckpointModel(): ' + this.modelName
|
assert(this.dataSource, 'Cannot getCheckpointModel(): ' + this.modelName +
|
||||||
+ ' is not attached to a dataSource');
|
' is not attached to a dataSource');
|
||||||
checkpointModel.attachTo(this.dataSource);
|
checkpointModel.attachTo(this.dataSource);
|
||||||
return checkpointModel;
|
return checkpointModel;
|
||||||
};
|
};
|
||||||
|
|
|
@ -119,8 +119,8 @@ module.exports = function(Role) {
|
||||||
* @returns {boolean}
|
* @returns {boolean}
|
||||||
*/
|
*/
|
||||||
function matches(id1, id2) {
|
function matches(id1, id2) {
|
||||||
if (id1 === undefined || id1 === null || id1 === ''
|
if (id1 === undefined || id1 === null || id1 === '' ||
|
||||||
|| id2 === undefined || id2 === null || id2 === '') {
|
id2 === undefined || id2 === null || id2 === '') {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
// The id can be a MongoDB ObjectID
|
// The id can be a MongoDB ObjectID
|
||||||
|
|
|
@ -1038,8 +1038,8 @@ PersistedModel.enableChangeTracking = function() {
|
||||||
var Change = this.Change || this._defineChangeModel();
|
var Change = this.Change || this._defineChangeModel();
|
||||||
var cleanupInterval = Model.settings.changeCleanupInterval || 30000;
|
var cleanupInterval = Model.settings.changeCleanupInterval || 30000;
|
||||||
|
|
||||||
assert(this.dataSource, 'Cannot enableChangeTracking(): ' + this.modelName
|
assert(this.dataSource, 'Cannot enableChangeTracking(): ' + this.modelName +
|
||||||
+ ' is not attached to a dataSource');
|
' is not attached to a dataSource');
|
||||||
|
|
||||||
Change.attachTo(this.dataSource);
|
Change.attachTo(this.dataSource);
|
||||||
Change.getCheckpointModel().attachTo(this.dataSource);
|
Change.getCheckpointModel().attachTo(this.dataSource);
|
||||||
|
|
|
@ -66,7 +66,7 @@
|
||||||
"grunt-contrib-jshint": "~0.10.0",
|
"grunt-contrib-jshint": "~0.10.0",
|
||||||
"grunt-contrib-uglify": "~0.5.1",
|
"grunt-contrib-uglify": "~0.5.1",
|
||||||
"grunt-contrib-watch": "~0.6.1",
|
"grunt-contrib-watch": "~0.6.1",
|
||||||
"grunt-jscs": "^0.8.1",
|
"grunt-jscs": "^1.5.0",
|
||||||
"grunt-karma": "~0.9.0",
|
"grunt-karma": "~0.9.0",
|
||||||
"grunt-mocha-test": "^0.11.0",
|
"grunt-mocha-test": "^0.11.0",
|
||||||
"karma": "~0.12.23",
|
"karma": "~0.12.23",
|
||||||
|
|
|
@ -112,6 +112,7 @@ describe('security ACLs', function() {
|
||||||
});
|
});
|
||||||
|
|
||||||
it('should allow access to models for the given principal by wildcard', function() {
|
it('should allow access to models for the given principal by wildcard', function() {
|
||||||
|
// jscs:disable validateIndentation
|
||||||
ACL.create({principalType: ACL.USER, principalId: 'u001', model: 'User', property: ACL.ALL,
|
ACL.create({principalType: ACL.USER, principalId: 'u001', model: 'User', property: ACL.ALL,
|
||||||
accessType: ACL.ALL, permission: ACL.ALLOW}, function(err, acl) {
|
accessType: ACL.ALL, permission: ACL.ALLOW}, function(err, acl) {
|
||||||
|
|
||||||
|
|
|
@ -241,8 +241,8 @@ describe('relations - integration', function() {
|
||||||
name: 'pa1'
|
name: 'pa1'
|
||||||
}, function(err, patient) {
|
}, function(err, patient) {
|
||||||
root.patient = patient;
|
root.patient = patient;
|
||||||
root.relUrl = '/api/physicians/' + root.physician.id
|
root.relUrl = '/api/physicians/' + root.physician.id +
|
||||||
+ '/patients/rel/' + root.patient.id;
|
'/patients/rel/' + root.patient.id;
|
||||||
done();
|
done();
|
||||||
});
|
});
|
||||||
} : function(done) {
|
} : function(done) {
|
||||||
|
@ -250,8 +250,8 @@ describe('relations - integration', function() {
|
||||||
name: 'pa1'
|
name: 'pa1'
|
||||||
}, function(err, patient) {
|
}, function(err, patient) {
|
||||||
root.patient = patient;
|
root.patient = patient;
|
||||||
root.relUrl = '/api/physicians/' + root.physician.id
|
root.relUrl = '/api/physicians/' + root.physician.id +
|
||||||
+ '/patients/rel/' + root.patient.id;
|
'/patients/rel/' + root.patient.id;
|
||||||
done();
|
done();
|
||||||
});
|
});
|
||||||
}], function(err, done) {
|
}], function(err, done) {
|
||||||
|
@ -367,8 +367,8 @@ describe('relations - integration', function() {
|
||||||
before(function(done) {
|
before(function(done) {
|
||||||
var self = this;
|
var self = this;
|
||||||
setup(true, function(err, root) {
|
setup(true, function(err, root) {
|
||||||
self.url = '/api/physicians/' + root.physician.id
|
self.url = '/api/physicians/' + root.physician.id +
|
||||||
+ '/patients/rel/' + '999';
|
'/patients/rel/' + '999';
|
||||||
self.patient = root.patient;
|
self.patient = root.patient;
|
||||||
self.physician = root.physician;
|
self.physician = root.physician;
|
||||||
done();
|
done();
|
||||||
|
@ -441,8 +441,8 @@ describe('relations - integration', function() {
|
||||||
before(function(done) {
|
before(function(done) {
|
||||||
var self = this;
|
var self = this;
|
||||||
setup(true, function(err, root) {
|
setup(true, function(err, root) {
|
||||||
self.url = '/api/physicians/' + root.physician.id
|
self.url = '/api/physicians/' + root.physician.id +
|
||||||
+ '/patients/' + root.patient.id;
|
'/patients/' + root.patient.id;
|
||||||
self.patient = root.patient;
|
self.patient = root.patient;
|
||||||
self.physician = root.physician;
|
self.physician = root.physician;
|
||||||
done();
|
done();
|
||||||
|
@ -462,8 +462,8 @@ describe('relations - integration', function() {
|
||||||
before(function(done) {
|
before(function(done) {
|
||||||
var self = this;
|
var self = this;
|
||||||
setup(true, function(err, root) {
|
setup(true, function(err, root) {
|
||||||
self.url = '/api/physicians/' + root.physician.id
|
self.url = '/api/physicians/' + root.physician.id +
|
||||||
+ '/patients/' + root.patient.id;
|
'/patients/' + root.patient.id;
|
||||||
self.patient = root.patient;
|
self.patient = root.patient;
|
||||||
self.physician = root.physician;
|
self.physician = root.physician;
|
||||||
done();
|
done();
|
||||||
|
|
|
@ -199,7 +199,7 @@ describe('remoting - integration', function() {
|
||||||
});
|
});
|
||||||
|
|
||||||
it('should have correct signatures for hasMany-through methods',
|
it('should have correct signatures for hasMany-through methods',
|
||||||
function() {
|
function() { // jscs:disable validateIndentation
|
||||||
|
|
||||||
var physicianClass = findClass('physician');
|
var physicianClass = findClass('physician');
|
||||||
var methods = physicianClass.methods
|
var methods = physicianClass.methods
|
||||||
|
|
|
@ -845,9 +845,9 @@ describe('User', function() {
|
||||||
it('Confirm a user verification', function(done) {
|
it('Confirm a user verification', function(done) {
|
||||||
testConfirm(function(result, done) {
|
testConfirm(function(result, done) {
|
||||||
request(app)
|
request(app)
|
||||||
.get('/users/confirm?uid=' + (result.uid)
|
.get('/users/confirm?uid=' + (result.uid) +
|
||||||
+ '&token=' + encodeURIComponent(result.token)
|
'&token=' + encodeURIComponent(result.token) +
|
||||||
+ '&redirect=' + encodeURIComponent(options.redirect))
|
'&redirect=' + encodeURIComponent(options.redirect))
|
||||||
.expect(302)
|
.expect(302)
|
||||||
.end(function(err, res) {
|
.end(function(err, res) {
|
||||||
if (err) {
|
if (err) {
|
||||||
|
@ -861,9 +861,9 @@ describe('User', function() {
|
||||||
it('Report error for invalid user id during verification', function(done) {
|
it('Report error for invalid user id during verification', function(done) {
|
||||||
testConfirm(function(result, done) {
|
testConfirm(function(result, done) {
|
||||||
request(app)
|
request(app)
|
||||||
.get('/users/confirm?uid=' + (result.uid + '_invalid')
|
.get('/users/confirm?uid=' + (result.uid + '_invalid') +
|
||||||
+ '&token=' + encodeURIComponent(result.token)
|
'&token=' + encodeURIComponent(result.token) +
|
||||||
+ '&redirect=' + encodeURIComponent(options.redirect))
|
'&redirect=' + encodeURIComponent(options.redirect))
|
||||||
.expect(404)
|
.expect(404)
|
||||||
.end(function(err, res) {
|
.end(function(err, res) {
|
||||||
if (err) {
|
if (err) {
|
||||||
|
@ -880,9 +880,9 @@ describe('User', function() {
|
||||||
it('Report error for invalid token during verification', function(done) {
|
it('Report error for invalid token during verification', function(done) {
|
||||||
testConfirm(function(result, done) {
|
testConfirm(function(result, done) {
|
||||||
request(app)
|
request(app)
|
||||||
.get('/users/confirm?uid=' + result.uid
|
.get('/users/confirm?uid=' + result.uid +
|
||||||
+ '&token=' + encodeURIComponent(result.token) + '_invalid'
|
'&token=' + encodeURIComponent(result.token) + '_invalid' +
|
||||||
+ '&redirect=' + encodeURIComponent(options.redirect))
|
'&redirect=' + encodeURIComponent(options.redirect))
|
||||||
.expect(400)
|
.expect(400)
|
||||||
.end(function(err, res) {
|
.end(function(err, res) {
|
||||||
if (err) {
|
if (err) {
|
||||||
|
|
Loading…
Reference in New Issue