From 7fceaa45536cc2d40d150ca7c7483f38b2532603 Mon Sep 17 00:00:00 2001 From: syuilo Date: Fri, 18 May 2018 06:14:33 +0900 Subject: [PATCH] Fix test --- test/api.ts | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/test/api.ts b/test/api.ts index d8c163e92..98c4cea84 100644 --- a/test/api.ts +++ b/test/api.ts @@ -2,7 +2,9 @@ * API TESTS */ +import * as fs from 'fs'; import * as merge from 'object-assign-deep'; +import * as chai from 'chai'; Error.stackTraceLimit = Infinity; @@ -12,11 +14,9 @@ process.env.NODE_ENV = 'test'; // Display detail of unhandled promise rejection process.on('unhandledRejection', console.dir); -const fs = require('fs'); -const _chai = require('chai'); const chaiHttp = require('chai-http'); -_chai.use(chaiHttp); +chai.use(chaiHttp); const server = require('../built/server/api').callback(); const db = require('../built/db/mongodb').default; @@ -34,7 +34,7 @@ const request = (endpoint, params, me?) => new Promise((ok, ng) => { i: me.token } : {}; - _chai.request(server) + chai.request(server) .post(endpoint) .send(Object.assign(auth, params)) .end((err, res) => { @@ -723,7 +723,7 @@ describe('API', () => { describe('drive/files/create', () => { it('ファイルを作成できる', async(async () => { const me = await insertSakurako(); - const res = await _chai.request(server) + const res = await chai.request(server) .post('/drive/files/create') .field('i', me.token) .attach('file', fs.readFileSync(__dirname + '/resources/Lenna.png'), 'Lenna.png');