Skip to content

Commit

Permalink
Add tests
Browse files Browse the repository at this point in the history
  • Loading branch information
Jacques de Villiers committed Nov 4, 2021
1 parent e97bc8c commit 043a8db
Show file tree
Hide file tree
Showing 3 changed files with 26 additions and 7 deletions.
1 change: 1 addition & 0 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

25 changes: 25 additions & 0 deletions tests/PhoneNumber.test.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
import { expect } from 'chai';
import PhoneNumber from '../src/PhoneNumber';

describe('getNumberType', () => {
it('returns UNKNOWN type', () => {
const number = '+44000';
const iso2 = 'gb';
const numberType = PhoneNumber.getNumberType(number, iso2);
expect(numberType).to.equal('UNKNOWN');
});

it('returns MOBILE type', () => {
const number = '+447900000001';
const iso2 = 'gb';
const numberType = PhoneNumber.getNumberType(number, iso2);
expect(numberType).to.equal('MOBILE');
});

it('returns FIXED_LINE type', () => {
const number = '+442072212217';
const iso2 = 'gb';
const numberType = PhoneNumber.getNumberType(number, iso2);
expect(numberType).to.equal('FIXED_LINE');
});
});
7 changes: 0 additions & 7 deletions tests/index.test.ts

This file was deleted.

0 comments on commit 043a8db

Please sign in to comment.