Permalink
Browse files

lint remaining tests

  • Loading branch information...
1 parent 61e10ae commit cf5f320cbeb2934d9ddadd68eaebdd889de95561 @ChristianMurphy ChristianMurphy committed Jul 24, 2015
View
@@ -1,2 +1,3 @@
docs/
bin/
+test/triage/
View
@@ -91,7 +91,6 @@ module.exports = function(config) {
sauceLabs: {
testName: 'Mongoose ' + Date.now()
- },
+ }
});
};
-
@@ -1453,7 +1453,7 @@ describe('document', function(){
assert.equal(3, Object.keys(doc._doc.nested).length);
assert.ok(doc.isModified('nested'));
- var doc = new TestDocument();
+ doc = new TestDocument();
doc.init({
test : 'Test'
, nested : {
@@ -6,7 +6,6 @@ var start = require('./common')
, assert = require('assert')
, mongoose = start.mongoose
, random = require('../lib/utils').random
- , Query = require('../lib/query')
, Schema = mongoose.Schema
, ObjectId = Schema.Types.ObjectId
, DocumentObjectId = mongoose.Types.ObjectId;
@@ -60,7 +60,6 @@ describe('model: mapreduce:', function(){
MR.create(docs, function (err, insertedDocs) {
assert.ifError(err);
- var a = insertedDocs[0];
var b = insertedDocs[1];
magicID = b._id;
@@ -374,7 +374,7 @@ describe('query stream:', function(){
var schema = Schema({
fullname: { type: String },
- password: { type: String, select: false },
+ password: { type: String, select: false }
});
var User = db.model('gh-1862', schema, 'gh-1862');
View
@@ -1447,7 +1447,7 @@ describe('Model', function(){
executed = true;
fn(v !== '');
}, 5);
- };
+ }
var Subdocs = new Schema({
required: { type: String, validate: [validator, 'async in subdocs'] }
@@ -2543,7 +2543,7 @@ describe('Model', function(){
assert.ok(v);
done();
});
- };
+ }
});
})
@@ -2592,7 +2592,7 @@ describe('Model', function(){
mongoose.model('Outer', Outer);
var db = start();
- var Outer = db.model('Outer', 'arr_test_' + random());
+ Outer = db.model('Outer', 'arr_test_' + random());
var outer = new Outer();
outer.inner.push({});
@@ -2641,7 +2641,7 @@ describe('Model', function(){
t.save(function (err) {
assert.ifError(err);
assert.equal(t.nested.nums.length,2);
- Temp.findById(t._id, function (err, found) {
+ Temp.findById(t._id, function (err) {
db.close();
assert.ifError(err);
assert.equal(t.nested.nums.length,2);
@@ -2831,7 +2831,7 @@ describe('Model', function(){
});
});
}
- };
+ }
function complete () {
Temp.findOne({ _id: t.get('_id') }, function (err, doc) {
@@ -2854,7 +2854,7 @@ describe('Model', function(){
assert.ok(v);
db.close(done);
});
- };
+ }
});
})
@@ -2897,7 +2897,7 @@ describe('Model', function(){
});
});
}
- };
+ }
function complete () {
StrList.findOne({ _id: t.get('_id') }, function (err, doc) {
@@ -2922,7 +2922,7 @@ describe('Model', function(){
assert.ok(v);
done();
});
- };
+ }
});
})
@@ -2964,7 +2964,7 @@ describe('Model', function(){
});
});
}
- };
+ }
function complete () {
BufList.findOne({ _id: t.get('_id') }, function (err, doc) {
@@ -2990,7 +2990,7 @@ describe('Model', function(){
done();
});
- };
+ }
});
})
@@ -3314,7 +3314,7 @@ describe('Model', function(){
doc.mixed.push([ 'foo', 'bar' ]);
doc.markModified('mixed');
- doc.save(function (err, doc) {
+ doc.save(function (err) {
assert.ifError(err);
BlogPost.findById(post2._id, function (err, doc) {
@@ -3387,7 +3387,7 @@ describe('Model', function(){
x: { y: { type: { type: String }, owner: String } }
}));
- var post = new TestDefaults2;
+ post = new TestDefaults2;
post.x.y.type = "#402";
post.x.y.owner= "me";
post.save(function (err) {
@@ -3434,7 +3434,7 @@ describe('Model', function(){
mongoose.model('SafeHuman', Human, true);
var db = start()
- , Human = db.model('SafeHuman', 'safehuman' + random());
+ Human = db.model('SafeHuman', 'safehuman' + random());
Human.on('index', function (err) {
assert.ifError(err);
@@ -3478,8 +3478,8 @@ describe('Model', function(){
mongoose.model('UnsafeHuman', Human, true);
- var db = start()
- , Human = db.model('UnsafeHuman', 'unsafehuman' + random());
+ var db = start();
+ Human = db.model('UnsafeHuman', 'unsafehuman' + random());
Human.on('index', function (err) {
assert.ifError(err);
@@ -3688,7 +3688,7 @@ describe('Model', function(){
var doc = new PreInit();
doc.save(function (err) {
assert.ifError(err);
- PreInit.findById(doc._id, function (err, found) {
+ PreInit.findById(doc._id, function (err) {
db.close();
assert.ifError(err);
assert.strictEqual(undefined, preId);
@@ -3780,9 +3780,7 @@ describe('Model', function(){
});
it('on embedded docs', function(done){
- var save = false,
- init = false,
- remove = false;
+ var save = false;
var EmbeddedSchema = new Schema({
title : String
@@ -3792,7 +3790,7 @@ describe('Model', function(){
embeds : [EmbeddedSchema]
});
- EmbeddedSchema.post('save', function(next){
+ EmbeddedSchema.post('save', function(){
save = true;
});
@@ -3830,7 +3828,7 @@ describe('Model', function(){
var db = start()
, BlogPost = db.model('BlogPost'+random(), bpSchema);
- BlogPost.create({title: 'interoperable count as promise'}, function (err, created) {
+ BlogPost.create({title: 'interoperable count as promise'}, function (err) {
assert.ifError(err);
var query = BlogPost.count({title: 'interoperable count as promise'});
query.exec(function (err, count) {
@@ -3847,7 +3845,7 @@ describe('Model', function(){
var db = start()
, BlogPost = db.model(col, bpSchema);
- BlogPost.create({title: 'interoperable update as promise'}, function (err, created) {
+ BlogPost.create({title: 'interoperable update as promise'}, function (err) {
assert.ifError(err);
var query = BlogPost.update({title: 'interoperable update as promise'}, {title: 'interoperable update as promise delta'});
query.exec(function (err) {
@@ -3908,7 +3906,7 @@ describe('Model', function(){
BlogPost.create(
{title: 'interoperable remove as promise'}
- , function (err, createdOne, createdTwo) {
+ , function (err) {
assert.ifError(err);
var query = BlogPost.remove({title: 'interoperable remove as promise'});
query.exec(function (err) {
@@ -3944,7 +3942,7 @@ describe('Model', function(){
var db = start()
, BlogPost = db.model('BlogPost'+random(), bpSchema);
- BlogPost.create({title: 'interoperable count as promise 2'}, function (err, created) {
+ BlogPost.create({title: 'interoperable count as promise 2'}, function (err) {
assert.ifError(err);
var query = BlogPost.count({title: 'interoperable count as promise 2'});
var promise = query.exec();
@@ -3962,7 +3960,7 @@ describe('Model', function(){
var db = start()
, BlogPost = db.model(col, bpSchema);
- BlogPost.create({title: 'interoperable update as promise 2'}, function (err, created) {
+ BlogPost.create({title: 'interoperable update as promise 2'}, function (err) {
assert.ifError(err);
var query = BlogPost.update({title: 'interoperable update as promise 2'}, {title: 'interoperable update as promise delta 2'});
var promise = query.exec();
@@ -4023,7 +4021,7 @@ describe('Model', function(){
BlogPost.create(
{title: 'interoperable remove as promise 2'}
- , function (err, createdOne, createdTwo) {
+ , function (err) {
assert.ifError(err);
var query = BlogPost.remove({title: 'interoperable remove as promise 2'});
var promise = query.exec();
@@ -4072,7 +4070,7 @@ describe('Model', function(){
{ name: 'brandon', likes: [d1] }
, { name: 'ben', likes: [d2] }
, { name: 'bernie', likes: [d3] }
- , function (err, brandon, ben, bernie) {
+ , function (err) {
assert.ifError(err);
var promise = B.find({ title: /^then promise/ }).select('_id').exec();
@@ -4084,7 +4082,7 @@ describe('Model', function(){
}).then(function (people) {
assert.equal(3, people.length);
return people;
- }).then(function (people) {
+ }).then(function () {
db.close();
done();
}, function (err) {
@@ -4122,8 +4120,6 @@ describe('Model', function(){
db.close();
- var a = '{ meta: { visitors: 45 },\n numbers: [ 5, 6, 7 ],\n owners: [ 4dd3e169dbfb13b4570000b6 ],\n comments: \n [{ _id: 4dd3e169dbfb13b4570000b7,\n comments: [],\n body: \'this is a comment\',\n date: Wed, 18 May 2011 15:02:31 GMT,\n title: \'my comment\' }\n { _id: 4dd3e169dbfb13b4570000b8,\n comments: [],\n body: \'this is a comment too!\',\n date: Wed, 18 May 2011 15:02:31 GMT,\n title: \'the next thang\' }],\n _id: 4dd3e169dbfb13b4570000b9,\n date: Wed, 18 May 2011 15:02:31 GMT,\n title: \'Test\' }'
-
var out = post.inspect();
assert.ok(/meta: { visitors: 45 }/.test(out));
assert.ok(/numbers: \[ 5, 6, 7 \]/.test(out));
@@ -4562,7 +4558,7 @@ describe('Model', function(){
assert.ifError(err);
doc.score = undefined; // unset
- doc.save(function (err, doc, count){
+ doc.save(function (err){
assert.ifError(err);
DefaultTestObject.findById(doc._id, function (err, doc){
@@ -5026,7 +5022,7 @@ describe('Model', function(){
var parentSchema = new Schema({
children: [new Schema({
- name: String,
+ name: String
})]
});
@@ -5037,7 +5033,7 @@ describe('Model', function(){
parent.save(function(err, it) {
assert.ifError(err);
parent.children.push({name: 'another child'});
- Parent.findByIdAndUpdate(it._id, { $set: { children: parent.children } }, function(err, affected) {
+ Parent.findByIdAndUpdate(it._id, { $set: { children: parent.children } }, function(err) {
assert.ifError(err);
db.close(done);
});
Oops, something went wrong.

0 comments on commit cf5f320

Please sign in to comment.