8
0

lodash.js 992 B

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