From e07eb4bce32c71315767f171c23173e8ac522e68 Mon Sep 17 00:00:00 2001 From: popomore Date: Fri, 19 Aug 2016 15:52:23 +0800 Subject: [PATCH] test: delete type testcase --- test/fixtures/ali-plugin/config/plugin.js | 13 ---------- test/fixtures/ali-plugin/package.json | 6 ----- .../dont-load-plugin/config/plugin.js | 2 -- test/fixtures/dont-load-plugin/package.json | 5 +--- test/loader/mixin/load_plugin.test.js | 24 ------------------- 5 files changed, 1 insertion(+), 49 deletions(-) delete mode 100644 test/fixtures/ali-plugin/config/plugin.js delete mode 100644 test/fixtures/ali-plugin/package.json diff --git a/test/fixtures/ali-plugin/config/plugin.js b/test/fixtures/ali-plugin/config/plugin.js deleted file mode 100644 index 3cd4795e..00000000 --- a/test/fixtures/ali-plugin/config/plugin.js +++ /dev/null @@ -1,13 +0,0 @@ -const path = require('path'); - -exports.foo = { - enable: true, - type: ['ali'], - path: path.join(__dirname, '../../../plugins/test-me') -}; - -exports.fooalipay = { - enable: true, - type: ['alipay'], - path: path.join(__dirname, '../../../plugins/test-me2') -}; diff --git a/test/fixtures/ali-plugin/package.json b/test/fixtures/ali-plugin/package.json deleted file mode 100644 index 00225149..00000000 --- a/test/fixtures/ali-plugin/package.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "name": "ali-plugin", - "chair": { - "type": "ali" - } -} diff --git a/test/fixtures/dont-load-plugin/config/plugin.js b/test/fixtures/dont-load-plugin/config/plugin.js index 3704aa02..96eb8951 100644 --- a/test/fixtures/dont-load-plugin/config/plugin.js +++ b/test/fixtures/dont-load-plugin/config/plugin.js @@ -3,12 +3,10 @@ const path = require('path'); exports.testMe = { enable: true, env: ['local'], - type: ['alipay'], path: path.join(__dirname, '../../../plugins/test-me') }; exports.testMeAli = { enable: true, - type: ['ali'], path: path.join(__dirname, '../../../plugins/test-me-ali') }; diff --git a/test/fixtures/dont-load-plugin/package.json b/test/fixtures/dont-load-plugin/package.json index 8f801199..e1460813 100644 --- a/test/fixtures/dont-load-plugin/package.json +++ b/test/fixtures/dont-load-plugin/package.json @@ -1,6 +1,3 @@ { - "name": "dont-load-plugin", - "egg": { - "type": "alipay" - } + "name": "dont-load-plugin" } diff --git a/test/loader/mixin/load_plugin.test.js b/test/loader/mixin/load_plugin.test.js index b7d4bfda..3e394800 100644 --- a/test/loader/mixin/load_plugin.test.js +++ b/test/loader/mixin/load_plugin.test.js @@ -293,30 +293,6 @@ describe('test/load_plugin.test.js', function() { }).should.not.containEql('testMe'); }); - it('should enable that match type', function() { - // mock local - mm(process.env, 'NODE_ENV', 'development'); - app = utils.createApp('dont-load-plugin'); - const loader = app.loader; - loader.loadPlugin(); - loader.loadConfig(); - const names = loader.orderPlugins.map(function(plugin) { - return plugin.name; - }); - names.should.containEql('testMe'); - }); - - it('should enable that match one type', function() { - app = utils.createApp('ali-plugin'); - const loader = app.loader; - loader.loadPlugin(); - loader.loadConfig(); - const names = loader.orderPlugins.map(function(plugin) { - return plugin.name; - }); - names.should.containEql('foo'); - }); - it('should complement infomation by config/plugin.js from plugin', function() { const baseDir = utils.getFilepath('plugin');