From 9a9f99d3720281f1c170e6f455b120e7b230307a Mon Sep 17 00:00:00 2001 From: TZ Date: Wed, 10 Apr 2019 10:42:41 +0800 Subject: [PATCH] chore: d.ts --- index.d.ts | 12 ++++++------ test/app/extend/context.test.js | 4 ++-- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/index.d.ts b/index.d.ts index 1997f2b5a6..5193b52335 100644 --- a/index.d.ts +++ b/index.d.ts @@ -7,13 +7,13 @@ import { Readable } from 'stream'; import { Socket } from 'net'; import { IncomingMessage, ServerResponse } from 'http'; import { EggLogger, EggLoggers, LoggerLevel as EggLoggerLevel, EggContextLogger } from 'egg-logger'; -import { HttpClient2, RequestOptions } from 'urllib'; +import { HttpClient2, RequestOptions2 as RequestOptions } from 'urllib'; import { EggCoreBase, FileLoaderOption, - EggLoader as CoreLoader, - EggCoreOptions as CoreOptions, - EggLoaderOptions as CoreLoaderOptions, + EggLoader as CoreLoader, + EggCoreOptions as CoreOptions, + EggLoaderOptions as CoreLoaderOptions, BaseContextClass as CoreBaseContextClass, } from 'egg-core'; import EggCookies = require('egg-cookies'); @@ -636,7 +636,7 @@ declare module 'egg' { truncated: boolean; } - + interface GetFileStreamOptions { requireFile?: boolean; // required file submit, default is true defCharset?: string; @@ -664,7 +664,7 @@ declare module 'egg' { * special properties (e.g: encrypted). So we must remove this property and * create our own with the same name. * @see https://github.com/eggjs/egg/pull/2958 - * + * * However, the latest version of Koa has "[key: string]: any" on the * context, and there'll be a type error for "keyof koa.Context". * So we have to directly inherit from "KoaApplication.BaseContext" and diff --git a/test/app/extend/context.test.js b/test/app/extend/context.test.js index 8d79b0dd94..5cf7267112 100644 --- a/test/app/extend/context.test.js +++ b/test/app/extend/context.test.js @@ -293,8 +293,8 @@ describe('test/app/extend/context.test.js', () => { .get('/error') .expect(200) .expect('hello error'); - assert(errorHadEmit); await sleep(5000); + assert(errorHadEmit); const logdir = app.config.logger.dir; const log = fs.readFileSync(path.join(logdir, 'common-error.log'), 'utf8'); assert(/ENOENT: no such file or directory/.test(log)); @@ -359,8 +359,8 @@ describe('test/app/extend/context.test.js', () => { .get('/error') .expect(200) .expect('hello error'); - assert(errorHadEmit); await sleep(5000); + assert(errorHadEmit); const logdir = app.config.logger.dir; const log = fs.readFileSync(path.join(logdir, 'common-error.log'), 'utf8'); assert(/ENOENT: no such file or directory/.test(log));