diff --git a/app.js b/app.js index 723f43a..67875be 100644 --- a/app.js +++ b/app.js @@ -1,15 +1,12 @@ const Koa = require('koa') const app = new Koa() const path = require('path') -const fs = require('fs') const config = require('./config') // require middleware const cors = require('kcors') -const koaBody = require('koa-body') const koaSession = require('koa-session2') const koaLogger = require('koa-logger') -const koaMount = require('koa-mount') const koaStatic = require('koa-static') if (process.env['NODE_ENV'] !== 'test') { @@ -30,4 +27,4 @@ const server = app.listen(config.port, () => { console.log(`start on port ${server.address().port}`) }) -module.exports = server \ No newline at end of file +module.exports = server diff --git a/config/index.js b/config/index.js index c613339..00d8612 100644 --- a/config/index.js +++ b/config/index.js @@ -6,6 +6,6 @@ module.exports = { port: process.env.DB_PORT || 5432, db: process.env.DB_NAME || 'mystorage', user: process.env.DB_USER || 'postgres', - pass: process.env.DB_PASS || '', + pass: process.env.DB_PASS || '' } -} \ No newline at end of file +} diff --git a/index.js b/index.js index a7a9110..3751745 100644 --- a/index.js +++ b/index.js @@ -1,3 +1,3 @@ process.env.__BASE = __dirname -const server = require('./app') +require('./app') diff --git a/route/index.js b/route/index.js index a37c404..f4f697a 100644 --- a/route/index.js +++ b/route/index.js @@ -5,7 +5,7 @@ r.use('/api', require('./api').routes()) r.get('/', async (c, n) => { c.status = 200 - c.body = "" + c.body = '' }) module.exports = r diff --git a/route/utils/message/index.js b/route/utils/message/index.js index 98a0c36..95eb93b 100644 --- a/route/utils/message/index.js +++ b/route/utils/message/index.js @@ -13,4 +13,4 @@ module.exports = { message: 'Internal Error' } } -} \ No newline at end of file +} diff --git a/test/api/index.js b/test/api/index.js index e6a2aa7..949afa4 100644 --- a/test/api/index.js +++ b/test/api/index.js @@ -1,10 +1,12 @@ - +/* eslint-disable no-unused-vars */ +/* eslint-disable no-undef */ +/* eslint-disable no-unused-expressions */ it('api root test', done => { chai.request(server) .get('/api') .end((err, res) => { chai.expect(err).to.be.null - chai.expect(res).to.be.status(200) + chai.expect(res).to.have.status(200) done() }) -}) \ No newline at end of file +}) diff --git a/test/index.js b/test/index.js index 191db16..e6fa005 100644 --- a/test/index.js +++ b/test/index.js @@ -1,3 +1,5 @@ +/* eslint-disable no-undef */ +/* eslint-disable no-unused-vars */ process.env['NODE_ENV'] = 'test' global.chai = require('chai') global.chaiHttp = require('chai-http') @@ -5,7 +7,6 @@ global.server = require('../app') global.chai.use(chaiHttp) - global.importTest = (name, path) => { describe(name, () => { require(path) @@ -14,4 +15,4 @@ global.importTest = (name, path) => { describe('Project Test', () => { importTest('Test API', './api') -}) \ No newline at end of file +})