8
0

lodash.js 993 B

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