<commit_before>import assert from "assert";
import merge, { merge as defaultMerge } from "../";
import mergeTests from "../helpers/merge-tests";
import loadersKeys from "../helpers/loaders-keys";

describe("Merge", function () {
  normalMergeTests(merge);
  mergeTests(merge);

  it("should export default merge", function () {
    assert.equal(merge, defaultMerge);
  });
});

function normalMergeTests(merge) {
  loadersKeys.forEach(function (loadersKey) {
    normalMergeTest(merge, loadersKey);
  });
}

function normalMergeTest(merge, loadersKey) {
  it("should work with an empty configuration", function () {
    assert.deepEqual(merge(), {});
  });

  it("should work with an empty array", function () {
    assert.deepEqual(merge([]), {});
  });

  it.only("should override with null (#144)", function () {
    const result = { devServer: null };

    assert.deepEqual(
      merge(
        {
          devServer: { base: true },
        },
        result
      ),
      result<commit_msg>fix: Drop .only from test<commit_after>import assert from "assert";
import merge, { merge as defaultMerge } from "../";
import mergeTests from "../helpers/merge-tests";
import loadersKeys from "../helpers/loaders-keys";

describe("Merge", function () {
  normalMergeTests(merge);
  mergeTests(merge);

  it("should export default merge", function () {
    assert.equal(merge, defaultMerge);
  });
});

function normalMergeTests(merge) {
  loadersKeys.forEach(function (loadersKey) {
    normalMergeTest(merge, loadersKey);
  });
}

function normalMergeTest(merge, loadersKey) {
  it("should work with an empty configuration", function () {
    assert.deepEqual(merge(), {});
  });

  it("should work with an empty array", function () {
    assert.deepEqual(merge([]), {});
  });

  it("should override with null (#144)", function () {
    const result = { devServer: null };

    assert.deepEqual(
      merge(
        {
          devServer: { base: true },
        },
        result
      ),
      result
{'fraction_non_alphanumeric': 0.15127309036445333, 'fraction_numerical': 0.0029955067398901645, 'mean_word_length': 3.385120350109409, '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': '5587518', 'n_tokens_mistral': 583, 'n_tokens_neox': 570, 'n_words': 145}