Skip to content

Commit

Permalink
add eslintrc
Browse files Browse the repository at this point in the history
  • Loading branch information
vkarpov15 committed Sep 3, 2024
1 parent 1311304 commit 7669db4
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 3 deletions.
14 changes: 14 additions & 0 deletions .eslintrc.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
'use strict';

module.exports = {
extends: [
'eslint:recommended'
],
parserOptions: {
ecmaVersion: 2018
},
env: {
node: true,
es6: true
}
};
5 changes: 2 additions & 3 deletions test/index.test.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
'use strict';

const assert = require('assert');
const co = require('co');
const mongoose = require('mongoose');
const mongooseLeanVirtuals = require('../');

Expand Down Expand Up @@ -623,7 +622,7 @@ describe('Discriminators work', () => {

it('sets empty array if no result and justOne: false', async function() {
const childSchema = new mongoose.Schema({ name: String, parentId: 'ObjectId' });
const Child = mongoose.model('C2', childSchema);
mongoose.model('C2', childSchema);

const parentSchema = new mongoose.Schema({ name: String });
parentSchema.virtual('children', {
Expand Down Expand Up @@ -688,7 +687,7 @@ describe('Discriminators work', () => {
const Parent = mongoose.model('Parent2', parentSchema);

const child = await Child.create({ name: 'Luke', surname: { name: 'Skywalker' } });
const parent = await Parent.create({ role: 'Father', surname: { name: 'Vader' }, allegiance: { name: 'Empire' }, child: child });
await Parent.create({ role: 'Father', surname: { name: 'Vader' }, allegiance: { name: 'Empire' }, child: child });
let doc = await Parent.findOne().populate('child').lean({ virtuals: true });
assert.ok(childGetterCalled);
assert.ok(parentGetterCalled);
Expand Down

0 comments on commit 7669db4

Please sign in to comment.