Repository URL to install this package:
Version:
0.9.5 ▾
|
/* eslint-disable max-statements */
import { isAlphaNumeric } from '../'
describe('validators.alphanumeric', () => {
it('allows valid alphanumeric values', () => {
// exotic.isNumberOrString is not a function
expect(isAlphaNumeric('4a6y')).toBeTruthy()
})
// it('does not allow undefined values', () => {
// expect(isAlphaNumeric(null)).toBeFalsy()
// expect(isAlphaNumeric(undefined)).toBeFalsy()
// })
// it('does not allow strings or numbers', () => {
// expect(isAlphaNumeric(6011000000000004)).toBeFalsy()
// expect(isAlphaNumeric('foobar')).toBeFalsy()
// })
// it('does not allow `invalid` alphanumeric values', () => {
// expect(isAlphaNumeric('')).toBeFalsy()
// expect(isAlphaNumeric(' ')).toBeFalsy()
// expect(isAlphaNumeric('loremIpsm')).toBeFalsy()
// expect(isAlphaNumeric('foo-bar')).toBeFalsy()
// expect(isAlphaNumeric('123456789')).toBeFalsy()
// expect(isAlphaNumeric('123-abc')).toBeFalsy()
// })
})