Added test for ScrambleStrings and formatted folder structure for other folders

This commit is contained in:
Omkarnath Parida
2021-10-03 17:28:17 +05:30
parent 255ef9a50d
commit c198a9f53d
12 changed files with 26 additions and 11 deletions

View File

@ -0,0 +1,23 @@
import { formatPhoneNumber } from '../FormatPhoneNumber'
describe('PhoneNumberFormatting', () => {
it('expects to return the formatted phone number', () => {
expect(formatPhoneNumber('1234567890')).toEqual('(123) 456-7890')
})
it('expects to return the formatted phone number', () => {
expect(formatPhoneNumber(1234567890)).toEqual('(123) 456-7890')
})
it('expects to throw a type error', () => {
expect(() => { formatPhoneNumber('1234567') }).toThrow('Invalid phone number.')
})
it('expects to throw a type error', () => {
expect(() => { formatPhoneNumber('123456text') }).toThrow('Invalid phone number.')
})
it('expects to throw a type error', () => {
expect(() => { formatPhoneNumber(12345) }).toThrow('Invalid phone number.')
})
})