|
|
@@ -3,41 +3,37 @@
|
|
|
* For licensing, see LICENSE.md.
|
|
|
*/
|
|
|
|
|
|
-/* globals describe, it, expect, CKEDITOR */
|
|
|
+/* globals describe, it, expect */
|
|
|
|
|
|
'use strict';
|
|
|
|
|
|
-describe( 'getPluginPath()', function() {
|
|
|
- it( 'should return a proper path', function( done ) {
|
|
|
- CKEDITOR.require( [ 'ckeditor' ], function( CKEDITOR ) {
|
|
|
- var basePath = CKEDITOR.basePath;
|
|
|
- var path = CKEDITOR.getPluginPath( 'test' );
|
|
|
-
|
|
|
- if ( CKEDITOR.isDev ) {
|
|
|
- expect( path ).to.equal( basePath + 'node_modules/ckeditor-plugin-test/src/' );
|
|
|
- } else {
|
|
|
- expect( path ).to.equal( basePath + 'plugins/test/' );
|
|
|
- }
|
|
|
- done();
|
|
|
- } );
|
|
|
+bender.amd.require( 'ckeditor', 'ckeditor-core' );
|
|
|
+
|
|
|
+describe( 'getPluginPath()', function( CKEDITOR, core ) {
|
|
|
+ it( 'should return a proper path', function() {
|
|
|
+ var basePath = CKEDITOR.basePath;
|
|
|
+ var path = CKEDITOR.getPluginPath( 'test' );
|
|
|
+
|
|
|
+ if ( CKEDITOR.isDev ) {
|
|
|
+ expect( path ).to.equal( basePath + 'node_modules/ckeditor-plugin-test/src/' );
|
|
|
+ } else {
|
|
|
+ expect( path ).to.equal( basePath + 'plugins/test/' );
|
|
|
+ }
|
|
|
} );
|
|
|
|
|
|
- it( '(the production version) should work even when in dev', function( done ) {
|
|
|
- CKEDITOR.require( [ 'ckeditor', 'ckeditor-core' ], function( CKEDITOR, core ) {
|
|
|
- // To be able to run this test on both dev and production code, we need to override getPluginPath with the
|
|
|
- // core version of it and restore it after testing.
|
|
|
- var originalGetPluginPath = CKEDITOR.getPluginPath;
|
|
|
- CKEDITOR.getPluginPath = core.getPluginPath;
|
|
|
+ it( '(the production version) should work even when in dev', function() {
|
|
|
+ // To be able to run this test on both dev and production code, we need to override getPluginPath with the
|
|
|
+ // core version of it and restore it after testing.
|
|
|
+ var originalGetPluginPath = CKEDITOR.getPluginPath;
|
|
|
+ CKEDITOR.getPluginPath = core.getPluginPath;
|
|
|
|
|
|
- // This test is good for both the development and production codes.
|
|
|
- var basePath = CKEDITOR.basePath;
|
|
|
- var path = CKEDITOR.getPluginPath( 'test' );
|
|
|
+ // This test is good for both the development and production codes.
|
|
|
+ var basePath = CKEDITOR.basePath;
|
|
|
+ var path = CKEDITOR.getPluginPath( 'test' );
|
|
|
|
|
|
- // Revert the override before assertions or it will not do it in case of errors.
|
|
|
- CKEDITOR.getPluginPath = originalGetPluginPath;
|
|
|
+ // Revert the override before assertions or it will not do it in case of errors.
|
|
|
+ CKEDITOR.getPluginPath = originalGetPluginPath;
|
|
|
|
|
|
- expect( path ).to.equal( basePath + 'plugins/test/' );
|
|
|
- done();
|
|
|
- } );
|
|
|
+ expect( path ).to.equal( basePath + 'plugins/test/' );
|
|
|
} );
|
|
|
} );
|