text: const expect = require('sort-any/tests/expect');
  const sortAny = require('sort-any');
  
  /* eslint-disable sort-keys */
  
  const globalExpected = [
    undefined,
    null,
    false,
    true,
    NaN,
    -Infinity,
    -21,
    -3,
    0,
    5,
    5,
    200,
    Infinity,
    'bar',
    'baz',
    'foo',
    'foo',
    'lorem',
    'lorem ipsum',
    'x',
    new Date('2021-07-01'),
    new Date('2021-07-02'),
    new Set(),
    new Set([1]),
    new Set(['foo']),
    new Set([new Set()]),
    new Set([new Set([1])]),
    new Set([new Set([1, 5])]),
    new Set([new Set([5, 1])]),
    new Set([[]]),
    new Set([1, 5]),
    new Set([5, 1]),
    new Set([1, 2, 3]),
    new Set(['foo', 'bar', 'baz']),
    [],
    [undefined],
    [null],
    [false],
    [true],
    [NaN],
    [-Infinity],
    [-21],
    [-3],
    [0],
    [5],
    [200],
    [Infinity],
    ['bar'],
    ['baz'],
    ['foo'],
    ['lorem'],
    ['lorem ipsum'],
    ['x'],
    [1, 5],
    [5, 1],
    [1, 20],
    [20, 1],
    [1, 300],
    [300, 1],
    [1, 'foo'],
    ['foo', 1],
    [2, 3],
    [3, 2],
    [2, 7],
    [2, 7],
    [7, 2],
    [3, 3],
    [3, 4],
    [4, 3],
    [3, 200],
    [200, 3],
    [1, 1, 1],
    [1, 2, 3],
    [1, 3, 2],
    [2, 1, 3],
    [2, 3, 1],
    [3, 1, 2],
    [3, 2, 1],
    [1, 2, 40],
    [1, 40, 2],
    [1, 2, 50],
    [1, 3, 3],
    [2, 2, 2],
    [2, 2, 5],
    [1, 2, 3, 4],
    [1, 2, 3, 40],
    new Map(),
    new Map([['bar', 1]]),
    new Map([['bar', 2]]),
    new Map([['foo', 1]]),
    new Map([['foo', 2]]),
    new Map([['bar', 1], ['foo', 2]]),
    new Map([['foo', 2], ['bar', 1]]),
    new Map([['foo', 2], ['bar', 2]]),
    new Map([['foo', 3], ['bar', 2]]),
    new Map([['foo', 2], ['bar', 3]]),
    {},
    { bar: 1 },
    { bar: 2 },
    { foo: 1 },
    { foo: 2 },
    { foo: new Date('2021-07-01') },
    { foo: new Date('2021-07-02') },
    { bar: 1, foo: 2 },
    { foo: 2, bar: 1 },
    { bar: 2, foo: 1 },
    { foo: 1, bar: 2 },
    { foo: 1, bar: 2 },
    { bar: 1, baz: 2, foo: 3 },
    { bar: 1, foo: 3, baz: 2 },
    { baz: 2, bar: 1, foo: 3 },
    { baz: 2, foo: 3, bar: 1 },
    { foo: 3, bar: 1, baz: 2 },
    { foo: 3, baz: 2, bar: 1 },
    { bar: 1, baz: 2, foo: 4 },
    { bar: 1, foo: 4, baz: 2 },
    { baz: 2, bar: 1, foo: 4 },
    { baz: 2, foo: 4, bar: 1 },
    { foo: 4, bar: 1, baz: 2 },
    { foo: 4, baz: 2, bar: 1 },
    { bar: 1, baz: 3, foo: 3 },
    { bar: 1, foo: 3, baz: 3 },
    { baz: 3, bar: 1, foo: 3 },
    { baz: 3, foo: 3, bar: 1 },
    { foo: 3, bar: 1, baz: 3 },
    { foo: 3, baz: 3, bar: 1 },
    { bar: 2, baz: 2, foo: 3 },
    { bar: 2, foo: 3, baz: 2 },
    { baz: 2, bar: 2, foo: 3 },
    { baz: 2, foo: 3, bar: 2 },
    { foo: 3, bar: 2, baz: 2 },
    { foo: 3, baz: 2, bar: 2 },
    { bar: 1, baz: 2, foo2: 3 },
    { bar: 1, baz2: 2, foo: 3 },
    { bar2: 1, baz: 2, foo: 3 },
    {
      bar: 1, baz: 2, foo: 3, foo2: 4,
    },
    {
      bar: 1, baz: 2, foo: 3, foo2: 5,
    },
    {
      bar: 1, baz: 2, foo: 4, foo2: 4,
    },
  ];
  
  describe('test', () => {
    it('sorts simple values', () => {
      const expected = [
        undefined,
        undefined,
        undefined,
        null,
        false,
        true,
        NaN,
        -Infinity,
        -21,
        -3,
        0,
        5,
        5,
        200,
        Infinity,
        'bar',
        'baz',
        'foo',
        'foo',
        'lorem',
        'lorem ipsum',
        'x',
        new Date('2021-01-01'),
        new Date('2021-01-01'),
        new Date('2021-01-02'),
        new Date('2021-01-03'),
        new Date('2022-01-01'),
      ];
      const array = [
        'foo',
        'baz',
        new Date('2021-01-01'),
        200,
        'lorem',
        -3,
        new Date('2021-01-02'),
        Infinity,
        'x',
        'foo',
        new Date('2021-01-01'),
        undefined,
        'bar',
        NaN,
        true,
        -Infinity,
        new Date('2022-01-01'),
        false,
        5,
        new Date('2021-01-03'),
        5,
        undefined,
        0,
        null,
        'lorem ipsum',
        -21,
        undefined,
      ];
      expect(JSON.parse(JSON.stringify(sortAny(array)))).to.deep.equal(JSON.parse(JSON.stringify(expected)));
    });
  
    it('sorts arrays - very simple example', () => {
      const expected = [
        [1, 2],
        [2, 1],
        [1, 3],
        [1, 2, 3],
      ];
      const array = [
        [1, 3],
        [1, 2],
        [1, 2, 3],
        [2, 1],
      ];
      expect(sortAny(array)).to.deep.equal(expected);
    });
  
    it('sorts arrays - simple example', () => {
      const expected = [
        [],
        [1],
        [2],
        [1, 2],
        [2, 1],
        [1, 3],
        [3, 1],
        [1, 2, 3],
        [3, 2, 1],
        [1, 2, 4],
        [1, 2, 3, 4],
      ];
      const array = [
        [3, 2, 1],
        [1, 2, 3],
        [1, 2],
        [],
        [1, 3],
        [1],
        [1, 2, 4],
        [1, 2, 3, 4],
        [2],
        [2, 1],
        [3, 1],
      ];
      expect(sortAny(array)).to.deep.equal(expected);
    });
  
    it('sorts arrays without symbols', () => {
      const expected = [
        [],
        [undefined],
        [null],
        [false],
        [true],
        [NaN],
        [-Infinity],
        [-21],
        [-3],
        [0],
        [5],
        [200],
        [Infinity],
        ['bar'],
        ['baz'],
        ['foo'],
        ['lorem'],
        ['lorem ipsum'],
        ['x'],
        [1, 5],
        [5, 1],
        [1, 20],
        [20, 1],
        [1, 300],
        [300, 1],
        [1, 'foo'],
        ['foo', 1],
        [2, 3],
        [3, 2],
        [2, 7],
        [2, 7],
        [7, 2],
        [3, 3],
        [3, 4],
        [4, 3],
        [3, 200],
        [200, 3],
        [1, 1, 1],
        [1, 2, 3],
        [1, 3, 2],
        [2, 1, 3],
        [2, 3, 1],
        [3, 1, 2],
        [3, 2, 1],
        [1, 2, 40],
        [1, 40, 2],
        [1, 2, 50],
        [1, 3, 3],
        [2, 2, 2],
        [2, 2, 5],
        [1, 2, 3, 4],
        [1, 2, 3, 40],
      ];
      const array = [
        [3, 2, 1],
        [2, 3, 1],
        ['lorem'],
        [1, 2, 3, 4],
        [1, 300],
        [1, 2, 40],
        [3, 200],
        [1, 40, 2],
        [3, 3],
        ['lorem ipsum'],
        [undefined],
        [Infinity],
        ['foo'],
        [3, 1, 2],
        [false],
        [true],
        [],
        [-3],
        [1, 3, 3],
        [1, 20],
        ['baz'],
        [2, 3],
        [1, 'foo'],
        [-21],
        [null],
        [2, 2, 5],
        [4, 3],
        [1, 5],
        [2, 7],
        [0],
        [1, 3, 2],
        [5],
        [20, 1],
        [3, 4],
        ['x'],
        [2, 1, 3],
        [2, 7],
        ['foo', 1],
        [1, 1, 1],
        [2, 2, 2],
        [1, 2, 3, 40],
        [3, 2],
        [200],
        [1, 2, 50],
        ['bar'],
        [1, 2, 3],
        [300, 1],
        [7, 2],
        [5, 1],
        [-Infinity],
        [200, 3],
        [NaN],
      ];
      expect(sortAny(array)).to.deep.equal(expected);
    });
  
    it('sorts objects - very simple example', () => {
      const expected = [
        {},
        { bar: 1 },
        { bar: 2 },
        { foo: 1 },
        { foo: 2 },
        { bar: 1, foo: 2 },
        { foo: 2, bar: 1 },
        { bar: 2, foo: 1 },
        { foo: 1, bar: 2 },
        { bar: 1, baz: 2, foo: 3 },
        { bar: 1, foo: 3, baz: 2 },
        { bar: 1, baz: 2, foo: 4 },
      ];
      const array = [
        { bar: 1, baz: 2, foo: 4 },
        { foo: 1, bar: 2 },
        { bar: 1, foo: 3, baz: 2 },
        { bar: 2, foo: 1 },
        { bar: 2 },
        {},
        { bar: 1, baz: 2, foo: 3 },
        { foo: 1 },
        { bar: 1, foo: 2 },
        { foo: 2 },
        { foo: 2, bar: 1 },
        { bar: 1 },
      ];
      expect(sortAny(array)).to.deep.equal(expected);
    });
  
    it('sorts - case 1', () => {
      const array = [
        [-Infinity],
        { baz: 3, bar: 1, foo: 3 },
        [4, 3],
        [2, 7],
        { foo: new Date('2021-07-02') },
        [1, 2, 50],
        { foo: 3, baz: 3, bar: 1 },
        [20, 1],
        [1, 'foo'],
        ['lorem ipsum'],
        [-21],
        { foo: 2 },
        [5],
        undefined,
        new Map([['bar', 2]]),
        [3, 2, 1],
        -Infinity,
        [-3],
        [3, 3],
        [5, 1],
        [2, 1, 3],
        new Date('2021-07-02'),
        [Infinity],
        new Set([new Set([5, 1])]),
        { foo: 3, baz: 2, bar: 1 },
        ['lorem'],
        { bar: 1, foo: 3, baz: 3 },
        200,
        new Set([1, 2, 3]),
        [7, 2],
        [200],
        [1, 3, 3],
        [2, 7],
        { baz: 3, foo: 3, bar: 1 },
        [3, 2],
        [2, 3, 1],
        [1, 2, 3, 4],
        [3, 1, 2],
        [false],
        [300, 1],
        -3,
        'baz',
        { foo: 1, bar: 2 },
        [undefined],
        { foo: new Date('2021-07-01') },
        [1, 5],
        Infinity,
        new Map([['foo', 2], ['bar', 3]]),
        {
          bar: 1, baz: 2, foo: 4, foo2: 4,
        },
        NaN,
        true,
        [2, 2, 5],
        { bar: 2, foo: 3, baz: 2 },
        [1, 2, 3],
        new Map([['bar', 1], ['foo', 2]]),
        new Map([['foo', 2], ['bar', 1]]),
        { baz: 2, foo: 3, bar: 2 },
        { bar: 1, foo: 4, baz: 2 },
        { foo: 3, baz: 2, bar: 2 },
        new Set([new Set([1, 5])]),
        ['baz'],
        [2, 3],
        { bar: 1, foo: 3, baz: 2 },
        [1, 2, 3, 40],
        { foo: 1, bar: 2 },
        new Set([[]]),
        [true],
        ['bar'],
        [3, 200],
        new Set([1, 5]),
        new Set([5, 1]),
        { bar: 1, baz2: 2, foo: 3 },
        'lorem',
        {
          bar: 1, baz: 2, foo: 3, foo2: 4,
        },
        { foo: 2, bar: 1 },
        'x',
        { bar: 2, baz: 2, foo: 3 },
        [2, 2, 2],
        { foo: 4, baz: 2, bar: 1 },
        { foo: 4, bar: 1, baz: 2 },
        { baz: 2, bar: 1, foo: 4 },
        [1, 2, 40],
        false,
        ['foo'],
        { bar: 1, baz: 3, foo: 3 },
        [NaN],
        -21,
        { foo: 3, bar: 2, baz: 2 },
        [],
        { bar: 1, foo: 2 },
        [1, 40, 2],
        new Set([1]),
        0,
        new Map(),
        { bar: 2, foo: 1 },
        [1, 3, 2],
        { bar: 1 },
        5,
        { foo: 3, bar: 1, baz: 2 },
        5,
        { foo: 3, bar: 1, baz: 3 },
        { bar: 1, baz: 2, foo2: 3 },
        'bar',
        { bar: 1, baz: 2, foo: 3 },
        { foo: 1 },
        [3, 4],
        new Map([['foo', 2]]),
        [null],
        { bar: 1, baz: 2, foo: 4 },
        { baz: 2, foo: 4, bar: 1 },
        'lorem ipsum',
        new Set([new Set()]),
        new Set([new Set([1])]),
        { baz: 2, foo: 3, bar: 1 },
        {},
        [0],
        { baz: 2, bar: 1, foo: 3 },
        ['foo', 1],
        [1, 1, 1],
        [1, 300],
        new Map([['bar', 1]]),
        { baz: 2, bar: 2, foo: 3 },
        { bar2: 1, baz: 2, foo: 3 },
        'foo',
        new Map([['foo', 3], ['bar', 2]]),
        {
          bar: 1, baz: 2, foo: 3, foo2: 5,
        },
        new Set(),
        new Date('2021-07-01'),
        ['x'],
        [1, 20],
        { bar: 2 },
        'foo',
        null,
        [200, 3],
        new Map([['foo', 2], ['bar', 2]]),
        new Set(['foo']),
        new Set(['foo', 'bar', 'baz']),
        new Map([['foo', 1]]),
      ];
      expect(sortAny(array)).to.deep.equal(globalExpected);
    });
  
    it('sorts - case 2', () => {
      const array = [
        { bar: 1, foo: 3, baz: 2 },
        -Infinity,
        [20, 1],
        [NaN],
        [5, 1],
        { foo: 3, baz: 2, bar: 1 },
        [1, 5],
        new Date('2021-07-01'),
        [200],
        [1, 2, 40],
        { baz: 2, foo: 3, bar: 1 },
        false,
        new Set([[]]),
        Infinity,
        [300, 1],
        new Map([['bar', 1], ['foo', 2]]),
        200,
        [false],
        'foo',
        { baz: 2, foo: 3, bar: 2 },
        [2, 1, 3],
        [0],
        new Set([1, 2, 3]),
        [4, 3],
        { foo: 4, bar: 1, baz: 2 },
        { foo: 3, bar: 2, baz: 2 },
        { foo: 2, bar: 1 },
        { baz: 3, bar: 1, foo: 3 },
        new Map([['foo', 2], ['bar', 2]]),
        [7, 2],
        ['lorem ipsum'],
        [1, 'foo'],
        { foo: 2 },
        [2, 2, 5],
        [3, 2, 1],
        new Map([['foo', 1]]),
        { baz: 2, bar: 1, foo: 4 },
        {
          bar: 1, baz: 2, foo: 4, foo2: 4,
        },
        { foo: new Date('2021-07-01') },
        5,
        [1, 40, 2],
        {
          bar: 1, baz: 2, foo: 3, foo2: 5,
        },
        { bar: 2, foo: 3, baz: 2 },
        undefined,
        [2, 3, 1],
        { foo: 1, bar: 2 },
        new Set([5, 1]),
        { foo: 3, bar: 1, baz: 3 },
        ['bar'],
        true,
        { baz: 3, foo: 3, bar: 1 },
        [1, 20],
        [3, 1, 2],
        'lorem',
        [1, 2, 3],
        -3,
        { foo: 3, baz: 3, bar: 1 },
        { baz: 2, foo: 4, bar: 1 },
        [1, 3, 2],
        { bar: 1, foo: 2 },
        { foo: new Date('2021-07-02') },
        { foo: 3, bar: 1, baz: 2 },
        { bar: 1, baz: 3, foo: 3 },
        { bar: 1, baz2: 2, foo: 3 },
        new Date('2021-07-02'),
        [200, 3],
        [5],
        -21,
        [-3],
        null,
        'x',
        [3, 4],
        [1, 2, 50],
        { bar: 1 },
        [1, 3, 3],
        'baz',
        { bar: 1, baz: 2, foo: 4 },
        [undefined],
        0,
        new Map([['bar', 2]]),
        {},
        [],
        ['baz'],
        { bar: 2, baz: 2, foo: 3 },
        ['foo'],
        { foo: 4, baz: 2, bar: 1 },
        'lorem ipsum',
        [1, 300],
        [3, 3],
        'foo',
        [2, 3],
        [-Infinity],
        { bar: 1, foo: 4, baz: 2 },
        [1, 2, 3, 4],
        new Map(),
        ['x'],
        [true],
        new Set([new Set()]),
        new Set([new Set([1])]),
        [Infinity],
        new Map([['foo', 2]]),
        { bar: 2 },
        { foo: 1, bar: 2 },
        'bar',
        { baz: 2, bar: 2, foo: 3 },
        {
          bar: 1, baz: 2, foo: 3, foo2: 4,
        },
        { foo: 3, baz: 2, bar: 2 },
        5,
        new Set(['foo']),
        { bar2: 1, baz: 2, foo: 3 },
        [3, 200],
        new Map([['foo', 2], ['bar', 1]]),
        [2, 7],
        ['lorem'],
        NaN,
        new Set([new Set([1, 5])]),
        new Set([new Set([5, 1])]),
        new Map([['foo', 3], ['bar', 2]]),
        [2, 7],
        { bar: 2, foo: 1 },
        [null],
        { bar: 1, foo: 3, baz: 3 },
        { bar: 1, baz: 2, foo2: 3 },
        new Map([['foo', 2], ['bar', 3]]),
        new Set([1]),
        { bar: 1, baz: 2, foo: 3 },
        [2, 2, 2],
        new Set([1, 5]),
        [1, 2, 3, 40],
        [3, 2],
        { foo: 1 },
        { baz: 2, bar: 1, foo: 3 },
        new Set(),
        ['foo', 1],
        [1, 1, 1],
        [-21],
        new Map([['bar', 1]]),
        new Set(['foo', 'bar', 'baz']),
      ];
      expect(sortAny(array)).to.deep.equal(globalExpected);
    });
  });
  