Sha256: 5aeef642869fb8590a7be3191f8b2985090a7f73e459e81e10a33c14cda97451

Contents?: true

Size: 626 Bytes

Versions: 3

Compression:

Stored size: 626 Bytes

Contents

import { A as emberA } from '../../../lib/mixins/array';
import { moduleFor, AbstractTestCase } from 'internal-test-helpers';

moduleFor(
  'NativeArray Copyable',
  class extends AbstractTestCase {
    ['@test deep copy is respected'](assert) {
      let array = emberA([{ id: 1 }, { id: 2 }, { id: 3 }]);
      let copiedArray;

      expectDeprecation(() => {
        copiedArray = array.copy(true);
      }, `Using \`NativeArray#copy\` is deprecated`);

      assert.deepEqual(copiedArray, array, 'copied array is equivalent');
      assert.ok(copiedArray[0] !== array[0], 'objects inside should be unique');
    }
  }
);

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
discourse-ember-source-3.6.0.0 dist/es/@ember/-internals/runtime/tests/system/native_array/copyable_suite_test.js
discourse-ember-source-3.5.1.1 dist/es/ember-runtime/tests/system/native_array/copyable_suite_test.js
discourse-ember-source-3.5.1.0 dist/dist/es/ember-runtime/tests/system/native_array/copyable_suite_test.js