<commit_before>'use strict';

var test = require('tape');
var clone = require('clone');
var cellophane = require('../');

test('remove(obj, opts)', function(t) {

  t.test('empty array', function(t) {
    var array = [];
    var original = cellophane(array);
    var result = original.remove({ foo: 1 });
    t.looseEqual(result.array, []);
    t.looseEqual(original.array, []);
    t.equal(original.array, array);
    t.notEqual(original, result);
    t.notEqual(original.array, result.array);
    t.end();
  });

  t.test('defaults to comparing by object value', function(t) {
    var array = [{ foo: 1 }, { foo: 2 }, { foo: 3 }];
    var original = cellophane(array);
    var result = original.remove({ foo: 2 });
    t.looseEqual(result.array, [{ foo: 1 }, { foo: 3 }]);
    t.looseEqual(original.array, [{ foo: 1 }, { foo: 2 }, { foo: 3 }]);
    t.equal(original.array, array);<commit_msg>Remove unused `clone` require<commit_after>'use strict';

var test = require('tape');
var cellophane = require('../');

test('remove(obj, opts)', function(t) {

  t.test('empty array', function(t) {
    var array = [];
    var original = cellophane(array);
    var result = original.remove({ foo: 1 });
    t.looseEqual(result.array, []);
    t.looseEqual(original.array, []);
    t.equal(original.array, array);
    t.notEqual(original, result);
    t.notEqual(original.array, result.array);
    t.end();
  });

  t.test('defaults to comparing by object value', function(t) {
    var array = [{ foo: 1 }, { foo: 2 }, { foo: 3 }];
    var original = cellophane(array);
    var result = original.remove({ foo: 2 });
    t.looseEqual(result.array, [{ foo: 1 }, { foo: 3 }]);
    t.looseEqual(original.array, [{ foo: 1 }, { foo: 2 }, { foo: 3 }]);
    t.equal(original.array, array);
{'fraction_non_alphanumeric': 0.19729425028184894, 'fraction_numerical': 0.011273957158962795, 'mean_word_length': 3.4375, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '7007830', 'n_tokens_mistral': 620, 'n_tokens_neox': 595, 'n_words': 145}