Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

test: delete type testcase #15

Merged
merged 1 commit into from
Aug 19, 2016
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 0 additions & 13 deletions test/fixtures/ali-plugin/config/plugin.js

This file was deleted.

6 changes: 0 additions & 6 deletions test/fixtures/ali-plugin/package.json

This file was deleted.

2 changes: 0 additions & 2 deletions test/fixtures/dont-load-plugin/config/plugin.js
Original file line number Diff line number Diff line change
Expand Up @@ -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')
};
5 changes: 1 addition & 4 deletions test/fixtures/dont-load-plugin/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,3 @@
{
"name": "dont-load-plugin",
"egg": {
"type": "alipay"
}
"name": "dont-load-plugin"
}
24 changes: 0 additions & 24 deletions test/loader/mixin/load_plugin.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -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');

Expand Down