|
|
@@ -87,7 +87,9 @@ CKEDITOR.define( 'plugin!I', [ 'plugin', 'plugin!J' ], function( Plugin ) {
|
|
|
|
|
|
// Note: This is NOT a plugin.
|
|
|
CKEDITOR.define( 'plugin!J', function() {
|
|
|
- return class {};
|
|
|
+ return function() {
|
|
|
+ return ( spies.jSpy = sinon.spy() );
|
|
|
+ };
|
|
|
} );
|
|
|
|
|
|
/////////////
|
|
|
@@ -313,6 +315,20 @@ describe( 'load', function() {
|
|
|
expect( err.message ).to.match( /^plugincollection-instance:/ );
|
|
|
} );
|
|
|
} );
|
|
|
+
|
|
|
+ it( 'should cancel loading module which looks like a plugin but is a normal module', function() {
|
|
|
+ var PluginCollection = modules.plugincollection;
|
|
|
+ var plugins = new PluginCollection( editor );
|
|
|
+
|
|
|
+ return plugins.load( 'J' )
|
|
|
+ .then( () => {
|
|
|
+ throw new Error( 'Test error: this promise should not be resolved successfully' );
|
|
|
+ } ).catch( () => {
|
|
|
+ // Path would be set if code execution wasn't stopped when we rejected the promise
|
|
|
+ // (based on a real mistake we've made).
|
|
|
+ expect( spies.jSpy.path ).to.be.undefined;
|
|
|
+ } );
|
|
|
+ } );
|
|
|
} );
|
|
|
|
|
|
describe( 'add', function() {
|