text: const suite = require('uvu').suite;
  const assert = require('assert');
  const { date, utils } = require('../src/index');
  const { setMatchingRules, getValue, compare } = utils;
  
  const test = suite('SetMatchingRules - date');
  
  test('date - default value - root string - comparison passes', () => {
    const actual = '2021-03-14';
    const value = date();
    assert.deepStrictEqual(value, {
      matcher: '^([\\+-]?\\d{4}(?!\\d{2}\\b))((-?)((0[1-9]|1[0-2])(\\3([12]\\d|0[1-9]|3[01]))?|W([0-4]\\d|5[0-2])(-?[1-7])?|(00[1-9]|0[1-9]\\d|[12]\\d{2}|3([0-5]\\d|6[1-6])))?)$',
      pactum_type: 'REGEX',
      value: '2020-12-12'
    });
    const rules = setMatchingRules({}, value, '$.body');
    assert.deepStrictEqual(rules, {
      '$.body': {
        match: 'regex',
        regex: '^([\\+-]?\\d{4}(?!\\d{2}\\b))((-?)((0[1-9]|1[0-2])(\\3([12]\\d|0[1-9]|3[01]))?|W([0-4]\\d|5[0-2])(-?[1-7])?|(00[1-9]|0[1-9]\\d|[12]\\d{2}|3([0-5]\\d|6[1-6])))?)$'
      }
    });
    const expected = getValue(value);
    const { equal, message } = compare(actual, expected, rules, '$.body');
    assert.strictEqual(equal, true);
    assert.strictEqual(message, '');
  });
  
  test('date - default value - root string - comparison passes', () => {
    const actual = '2021-03-1';
    const value = date();
    assert.deepStrictEqual(value, {
      matcher: '^([\\+-]?\\d{4}(?!\\d{2}\\b))((-?)((0[1-9]|1[0-2])(\\3([12]\\d|0[1-9]|3[01]))?|W([0-4]\\d|5[0-2])(-?[1-7])?|(00[1-9]|0[1-9]\\d|[12]\\d{2}|3([0-5]\\d|6[1-6])))?)$',
      pactum_type: 'REGEX',
      value: '2020-12-12'
    });
    const rules = setMatchingRules({}, value, '$.body');
    assert.deepStrictEqual(rules, {
      '$.body': {
        match: 'regex',
        regex: '^([\\+-]?\\d{4}(?!\\d{2}\\b))((-?)((0[1-9]|1[0-2])(\\3([12]\\d|0[1-9]|3[01]))?|W([0-4]\\d|5[0-2])(-?[1-7])?|(00[1-9]|0[1-9]\\d|[12]\\d{2}|3([0-5]\\d|6[1-6])))?)$'
      }
    });
    const expected = getValue(value);
    const { equal, message } = compare(actual, expected, rules, '$.body');
    assert.strictEqual(equal, false);
    assert.strictEqual(message, `Json doesn't match with "^([\\+-]?\\d{4}(?!\\d{2}\\b))((-?)((0[1-9]|1[0-2])(\\3([12]\\d|0[1-9]|3[01]))?|W([0-4]\\d|5[0-2])(-?[1-7])?|(00[1-9]|0[1-9]\\d|[12]\\d{2}|3([0-5]\\d|6[1-6])))?)$" at "$.body" but found "2021-03-1"`);
  });
  
  test.run();