mirror of
https://github.com/wassname/talk.git
synced 2026-07-03 02:01:05 +08:00
Lint for test.
This commit is contained in:
@@ -1,13 +1,16 @@
|
||||
const express = require('express');
|
||||
|
||||
const Comment = require('../../../models/comment');
|
||||
const User = require('../../../models/user');
|
||||
const Action = require('../../../models/action');
|
||||
|
||||
const router = express.Router();
|
||||
|
||||
router.get('/', (req, res, next) => {
|
||||
const comments = Comment.findByAssetId(req.query.asset_id) || [];
|
||||
const users = User.findByIdArray(comments.map((comment) => comment.author_id));
|
||||
const actions = Action.findByItemIdArray(comments.map((comment) => comment.id));
|
||||
|
||||
res.json(comments.concat(users).concat(actions)).catch(next);
|
||||
});
|
||||
|
||||
|
||||
@@ -5,6 +5,6 @@
|
||||
},
|
||||
"extends": "eslint:recommended",
|
||||
"rules": {
|
||||
no-undef: [1]
|
||||
"no-undef": [0]
|
||||
}
|
||||
}
|
||||
@@ -1,10 +1,7 @@
|
||||
// Modified from https://github.com/elliotf/mocha-mongoose
|
||||
|
||||
var mongoose = require('mongoose');
|
||||
|
||||
|
||||
// ensure the NODE_ENV is set to 'test'
|
||||
// this is helpful when you would like to change behavior when testing
|
||||
// Ensure the NODE_ENV is set to 'test',
|
||||
// this is helpful when you would like to change behavior when testing.
|
||||
process.env.NODE_ENV = 'test';
|
||||
|
||||
beforeEach(function (done) {
|
||||
|
||||
Reference in New Issue
Block a user