@@ -11,6 +11,7 @@ const utils = require('../../utils');
1111const EggCore = require ( '../../..' ) . EggCore ;
1212const EggLoader = require ( '../../..' ) . EggLoader ;
1313
14+
1415describe ( 'test/load_plugin.test.js' , function ( ) {
1516 let app ;
1617 afterEach ( mm . restore ) ;
@@ -281,18 +282,26 @@ describe('test/load_plugin.test.js', function() {
281282 } ) ;
282283
283284 it ( 'should enable dependencies implicitly but not optionalDependencies' , done => {
285+ class Application extends EggCore {
286+ get [ Symbol . for ( 'egg#eggPath' ) ] ( ) {
287+ return utils . getFilepath ( 'plugin-dep-disable/framework' ) ;
288+ }
289+ }
290+
284291 done = pedding ( done , 2 ) ;
285- app = utils . createApp ( 'plugin-dep-disable' ) ;
292+ app = utils . createApp ( 'plugin-dep-disable' , {
293+ Application,
294+ } ) ;
286295 mm ( app . console , 'info' , msg => {
287296 if ( msg . startsWith ( '[egg:loader] eggPlugin is missing' ) ) {
288297 done ( new Error ( 'should no run here' ) ) ;
289298 return ;
290299 }
291- assert ( msg === 'Following plugins will be enabled implicitly.\n - b required by [a,d]\n - c required by [a]' ) ;
300+ assert ( msg === 'Following plugins will be enabled implicitly.\n - b required by [a,d]\n - e required by [c]\n - c required by [a]' ) ;
292301 done ( ) ;
293302 } ) ;
294303 mm ( app . console , 'warn' , msg => {
295- assert ( msg === 'Following plugins will be enabled implicitly that is disabled by application.\n - b required by [a,d]\n - c required by [a ]' ) ;
304+ assert ( msg === 'Following plugins will be enabled implicitly that is disabled by application.\n - e required by [c ]' ) ;
296305 done ( ) ;
297306 } ) ;
298307 const loader = app . loader ;
0 commit comments