Skip to content

Commit

Permalink
f
Browse files Browse the repository at this point in the history
  • Loading branch information
fengmk2 committed Dec 17, 2024
1 parent a840f92 commit ad17599
Show file tree
Hide file tree
Showing 7 changed files with 46 additions and 4 deletions.
2 changes: 0 additions & 2 deletions test/fixtures/plugin-egg-plugin/config/plugin.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
'use strict';

module.exports = {
a: {
enable: true,
Expand Down
5 changes: 5 additions & 0 deletions test/fixtures/plugin-pkg-exports/config/plugin.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
module.exports = {
a: {
enable: true,
},
};

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

9 changes: 9 additions & 0 deletions test/fixtures/plugin-pkg-exports/node_modules/a/package.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 3 additions & 0 deletions test/fixtures/plugin-pkg-exports/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"name": "plugin-pkg-exports"
}
15 changes: 13 additions & 2 deletions test/loader/mixin/load_plugin.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,14 +14,25 @@ describe('test/loader/mixin/load_plugin.test.ts', () => {
app = undefined;
});

it('should exports allPlugins, appPlugins, customPlugins, eggPlugins', () => {
it('should exports allPlugins, appPlugins, customPlugins, eggPlugins', async () => {
app = createApp('plugin');
const loader = app.loader;
loader.loadPlugin();
await loader.loadPlugin();
assert('allPlugins' in loader);
assert('appPlugins' in loader);
assert('customPlugins' in loader);
assert('eggPlugins' in loader);
});

it('should load plugin by pkg.eggPlugin.exports', async () => {
app = createApp('plugin-pkg-exports');
const loader = app.loader;
await loader.loadPlugin();
assert('allPlugins' in loader);
assert('appPlugins' in loader);
assert('customPlugins' in loader);
assert('eggPlugins' in loader);
assert(loader.plugins.a.enable);
});

it('should loadConfig all plugins', async () => {
Expand Down

0 comments on commit ad17599

Please sign in to comment.