amd.js 774 B

12345678910111213141516171819202122232425262728293031
  1. /**
  2. * @license Copyright (c) 2003-2015, CKSource - Frederico Knabben. All rights reserved.
  3. * For licensing, see LICENSE.md.
  4. */
  5. /* globals describe, it, expect, CKEDITOR */
  6. 'use strict';
  7. CKEDITOR.define( 'testModule', [ 'ckeditor', 'utils' ], function( ckeditor, utils ) {
  8. return {
  9. test: utils.isObject( ckeditor )
  10. };
  11. } );
  12. describe( 'CKEDITOR.require()', function() {
  13. it( 'should work with a defined module', function( done ) {
  14. CKEDITOR.require( [ 'testModule' ], function( testModule ) {
  15. expect( testModule ).to.have.property( 'test' ).to.be.true();
  16. done();
  17. } );
  18. } );
  19. it( 'should work with a core module', function( done ) {
  20. CKEDITOR.require( [ 'utils' ], function( utils ) {
  21. expect( utils ).to.be.an( 'object' );
  22. done();
  23. } );
  24. } );
  25. } );