<commit_before>var assert = require('assert');
var PhoneFormatter = require('../')

describe('Normalize', function() {
  
  var testFormats = [
    "(212) 555 1212",
    "(212) 555.1212",
    "(212) 555-1212",
    "(212) 5551212",
    "(212)5551212",
    "212 555 1212",
    "212.555.1212",
    "212-555-1212",
    "1-212-555-1212",
    "+1 (212) 555-1212",
    "+1 (212) 555 - 1212",
    "12125551212",
    "+45 (212) 555-1212",
    "2125551212",
  ]
  
  testFormats.forEach(function(number) {
    it('should be able to parse ' + number, function() {
      assert.deepEqual(
        PhoneFormatter.normalize(number),
        "2125551212"
      );
    });
  });

  it('should skip undefined phone number', function() {
    assert.deepEqual(
      PhoneFormatter.normalize(undefined),
      undefined
    );
  });
});

describe('Format', function() {
  
  var phoneNumber = "2125551212"<commit_msg>test: add normalize test<commit_after>var assert = require('assert');
var PhoneFormatter = require('../')

describe('Normalize', function() {
  
  var testFormats = [
    "(212) 555 1212",
    "(212) 555.1212",
    "(212) 555-1212",
    "(212) 5551212",
    "(212)5551212",
    "212 555 1212",
    "212.555.1212",
    "212-555-1212",
    "1-212-555-1212",
    "+1 (212) 555-1212",
    "+1 (212) 555 - 1212",
    "12125551212",
    "+45 (212) 5551212",
    "+45 (212) 555-1212",
    "+45-(212)-5551212",
    "+45-(212)-555-1212",
    "+45 212 555 1212",
    "+45-212-555-1212",
    "2125551212",
  ]
  
  testFormats.forEach(function(number) {
    it('should be able to parse ' + number, function() {
      assert.deepEqual(
        PhoneFormatter.normalize(number),
        "2125551212"
      );
    });
  });

  it('should skip undefined phone number', function() {
    assert.deepEqual(
      PhoneFormatter.normalize(undefined),
      undefined
    );
  });

  it('test', () => {
    console.log(PhoneFormatter.normalize("+86-574-2772681"));
    console.log(PhoneFormatter.normalize("+852 2332 5051"));
  })
});

describe('Format', function() {
  
  var phoneNumber = "2125551212"
{'fraction_non_alphanumeric': 0.18644882268140317, 'fraction_numerical': 0.19942335415665546, 'mean_word_length': 2.7854545454545456, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 4, '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': '1297944', 'n_tokens_mistral': 1022, 'n_tokens_neox': 743, 'n_words': 143}