Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update Canada phone number #138

Merged
merged 1 commit into from
Feb 28, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 18 additions & 0 deletions __tests__/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -1092,6 +1092,24 @@ describe( 'Testing MMR Phone', () => {
});


describe( 'Testing Canada Phone', () => {
describe('Should return result when it match 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', () => {
const number = '+1 111 1234567';
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
2 changes: 1 addition & 1 deletion lib/iso3166Data.js
Original file line number Diff line number Diff line change
Expand Up @@ -324,7 +324,7 @@ module.exports = [
alpha3: 'CAN',
country_code: '1',
country_name: 'Canada',
mobile_begin_with: ['204', '226', '236', '249', '250', '289', '306', '343', '365', '403', '416', '418', '431',
mobile_begin_with: ['204', '226', '236', '249', '250', '289', '306', '343', '365', '367', '403', '416', '418', '431',
'437', '438', '450', '506', '514', '519', '579', '581', '587', '600', '604', '613', '639', '647', '705',
'709', '778', '780', '807', '819', '867', '873', '902', '905'],
phone_number_lengths: [10]
Expand Down