Skip to content

Commit

Permalink
Merge pull request #139 from SoutouKakka/update-cameroon-new-caledonia
Browse files Browse the repository at this point in the history
Update cameroon new caledonia
  • Loading branch information
SoutouKakka authored Mar 1, 2019
2 parents 72e94f6 + 7e0e5dd commit 632dc6a
Show file tree
Hide file tree
Showing 2 changed files with 41 additions and 5 deletions.
40 changes: 38 additions & 2 deletions __tests__/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -1093,14 +1093,14 @@ describe( 'Testing MMR Phone', () => {


describe( 'Testing Canada Phone', () => {
describe('Should return result when it match begin with', () => {
describe('Should return result when it matches mobile_begin_with', () => {
const number = '+1 367 1234567';
const result = ['+13671234567', 'CAN'];
test('returns ' + result, () => {
expect(phone(number)).toEqual(result);
});
});
describe('Should not return result when it match begin with', () => {
describe('Should not return result when it does not match mobile_begin_with', () => {
const number = '+1 111 1234567';
const result = [];
test('returns ' + result, () => {
Expand All @@ -1110,6 +1110,42 @@ describe( 'Testing Canada Phone', () => {
});


describe( 'Testing Cameroon Phone', () => {
describe('Should return result when it matches mobile_begin_with', () => {
const number = '+237 612345678';
const result = ['+237612345678', 'CMR'];
test('returns ' + result, () => {
expect(phone(number)).toEqual(result);
});
});
describe('Should not return result when it does not match mobile_begin_with', () => {
const number = '+237 112345678';
const result = [];
test('returns ' + result, () => {
expect(phone(number)).toEqual(result);
});
});
});


describe( 'Testing New Caledonia Phone', () => {
describe('Should return result when it matches mobile_begin_with', () => {
const number = '+687 812345';
const result = ['+687812345', 'NCL'];
test('returns ' + result, () => {
expect(phone(number)).toEqual(result);
});
});
describe('Should not return result when it does not match mobile_begin_with', () => {
const number = '+687 112345';
const result = [];
test('returns ' + result, () => {
expect(phone(number)).toEqual(result);
});
});
});


describe('test phone with trunk prefix', () => {
test('Austrilia phone with trunk prefix (0)', () => {
const number = '+61(0)488888888';
Expand Down
6 changes: 3 additions & 3 deletions lib/iso3166Data.js
Original file line number Diff line number Diff line change
Expand Up @@ -367,8 +367,8 @@ module.exports = [
alpha3: 'CMR',
country_code: '237',
country_name: 'Cameroon',
mobile_begin_with: ['7', '9'],
phone_number_lengths: [8]
mobile_begin_with: ['6'],
phone_number_lengths: [9]
},
{
alpha2: 'CD',
Expand Down Expand Up @@ -1223,7 +1223,7 @@ module.exports = [
alpha3: 'NCL',
country_code: '687',
country_name: 'New Caledonia',
mobile_begin_with: [],
mobile_begin_with: ['7', '8', '9'],
phone_number_lengths: [6]
},
{
Expand Down

0 comments on commit 632dc6a

Please sign in to comment.