lodash.js 1.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  1. /**
  2. * @license Copyright (c) 2003-2016, CKSource - Frederico Knabben. All rights reserved.
  3. * For licensing, see LICENSE.md.
  4. */
  5. 'use strict';
  6. const modules = bender.amd.require( 'core/lib/lodash/object' );
  7. describe( 'utils', () => {
  8. let objectUtils;
  9. before( () => {
  10. objectUtils = modules[ 'core/lib/lodash/object' ];
  11. } );
  12. describe( 'extend()', () => {
  13. // Properties of the subsequent objects should override properties of the preceding objects. This is critical for
  14. // CKEditor so we keep this test to ensure that Lo-Dash (or whatever) implements it in the way we need it.
  15. it( 'should extend by several params in the correct order', () => {
  16. let target = {
  17. a: 0,
  18. b: 0
  19. };
  20. let ext1 = {
  21. b: 1,
  22. c: 1
  23. };
  24. let ext2 = {
  25. c: 2,
  26. d: 2
  27. };
  28. objectUtils.extend( target, ext1, ext2 );
  29. expect( target ).to.have.property( 'a' ).to.equal( 0 );
  30. expect( target ).to.have.property( 'b' ).to.equal( 1 );
  31. expect( target ).to.have.property( 'c' ).to.equal( 2 );
  32. expect( target ).to.have.property( 'd' ).to.equal( 2 );
  33. } );
  34. } );
  35. } );