From 531cf9c26dea5363db68d99dfcc45a721a90070b Mon Sep 17 00:00:00 2001 From: TZ Date: Wed, 28 Mar 2018 16:17:57 +0800 Subject: [PATCH] fff --- .autod.conf | 2 +- package.json | 1 - test/fixtures/ts/app.ts | 6 ------ test/fixtures/ts/test.ts | 3 --- test/lib/cmd/cov.test.js | 15 +++++++++++++++ test/ts.test.js | 4 ++-- 6 files changed, 18 insertions(+), 13 deletions(-) delete mode 100644 test/fixtures/ts/app.ts delete mode 100644 test/fixtures/ts/test.ts diff --git a/.autod.conf b/.autod.conf index 1ca8ef14..2530613c 100644 --- a/.autod.conf +++ b/.autod.conf @@ -20,7 +20,7 @@ module.exports = { 'egg', 'autod', 'eslint-config-egg', - 'egg-ci', + // 'egg-ci', ], keep: [ ], diff --git a/package.json b/package.json index 2df90b14..de392313 100644 --- a/package.json +++ b/package.json @@ -37,7 +37,6 @@ "coffee": "^4.1.0", "cross-env": "^3.1.3", "egg": "^2.5.0", - "egg-ci": "^1.8.0", "egg-mock": "^3.15.1", "enzyme": "^2.0.0", "eslint": "^4.12.1", diff --git a/test/fixtures/ts/app.ts b/test/fixtures/ts/app.ts deleted file mode 100644 index e46106f7..00000000 --- a/test/fixtures/ts/app.ts +++ /dev/null @@ -1,6 +0,0 @@ -'use strict'; - - -module.exports = app => { - app.logger.info('###', require('./test.ts').default.name); -}; diff --git a/test/fixtures/ts/test.ts b/test/fixtures/ts/test.ts deleted file mode 100644 index 61519692..00000000 --- a/test/fixtures/ts/test.ts +++ /dev/null @@ -1,3 +0,0 @@ -'use strict'; - -export default { name: 'egg from ts' }; diff --git a/test/lib/cmd/cov.test.js b/test/lib/cmd/cov.test.js index 16064e51..ad181351 100644 --- a/test/lib/cmd/cov.test.js +++ b/test/lib/cmd/cov.test.js @@ -188,4 +188,19 @@ describe('test/lib/cmd/cov.test.js', () => { .expect('code', 0) .end(); }); + + it('should support typescript', () => { + if (process.env.EGG_VERSION && process.env.EGG_VERSION === '1') { + console.log('skip egg@1'); + return; + } + const cwd = path.join(__dirname, '../../fixtures/example-ts'); + return coffee.fork(eggBin, [ 'cov', '--ts' ], { cwd }) + // .debug() + .expect('stdout', /hi, egg, 123456/) + .expect('stdout', /should work/) + .expect('stdout', process.env.NYC_ROOT_ID ? /Coverage summary/ : /Statements.*100%/) + .expect('code', 0) + .end(); + }); }); diff --git a/test/ts.test.js b/test/ts.test.js index 9f6f3ede..30ed6eef 100644 --- a/test/ts.test.js +++ b/test/ts.test.js @@ -15,7 +15,6 @@ describe('test/ts.test.js', () => { mm(process.env, 'NODE_ENV', 'development'); return coffee.fork(eggBin, [ 'dev', '--typescript' ], { cwd }) // .debug() - .expect('stdout', /### egg from ts/) .expect('stdout', /options.typescript=true/) .expect('stdout', /started/) .expect('code', 0) @@ -72,7 +71,8 @@ describe('test/ts.test.js', () => { // .debug() .expect('stdout', /hi, egg, 123456/) .expect('stdout', /should work/) - .expect('stdout', /Statements.*100%/) + // see `cov.test.js` for Statements assert + .expect('stdout', /Coverage summary/) .expect('code', 0) .end(); });