ckeditor.js 1.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051
  1. /**
  2. * @license Copyright (c) 2003-2015, CKSource - Frederico Knabben. All rights reserved.
  3. * For licensing, see LICENSE.md.
  4. */
  5. 'use strict';
  6. const modules = bender.amd.require( 'ckeditor' );
  7. let CKEDITOR;
  8. before( () => {
  9. CKEDITOR = modules.ckeditor;
  10. } );
  11. describe( 'isDebug', () => {
  12. it( 'is a boolean', () => {
  13. expect( CKEDITOR.isDebug ).to.be.a( 'boolean' );
  14. } );
  15. } );
  16. describe( 'getModulePath()', () => {
  17. it( 'generates path for the main file', () => {
  18. const path = CKEDITOR.getModulePath( 'ckeditor' );
  19. expect( path ).to.equal( 'ckeditor.js' );
  20. } );
  21. it( 'generates path for modules within ckeditor5 package', () => {
  22. const path = CKEDITOR.getModulePath( 'ckeditor5/foo' );
  23. expect( path ).to.equal( 'ckeditor5/foo.js' );
  24. } );
  25. it( 'generates path for modules within the core package', () => {
  26. const path = CKEDITOR.getModulePath( 'core/ui/controller' );
  27. expect( path ).to.equal( 'ckeditor5-core/ui/controller.js' );
  28. } );
  29. it( 'generates path for modules within some package', () => {
  30. const path = CKEDITOR.getModulePath( 'some/ba' );
  31. expect( path ).to.equal( 'ckeditor5-some/ba.js' );
  32. } );
  33. it( 'generates path from simplified feature name', () => {
  34. const path = CKEDITOR.getModulePath( 'foo' );
  35. expect( path ).to.equal( 'ckeditor5-foo/foo.js' );
  36. } );
  37. } );