Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
import {AvValidator} from 'availity-reactstrap-validation';
const fn = AvValidator.number;
describe('Number Validation', () => {
it('should not require a value', () => {
expect(fn('')).to.be.true;
});
it('should return custom error message if provided when field is not valid', () => {
expect(fn('a4', undefined, {errorMessage: 'NaN!'})).to.equal('NaN!');
});
it('should accept numbers', () => {
expect(fn(0)).to.be.true;
expect(fn(-1)).to.be.true;
expect(fn(1)).to.be.true;
expect(fn(10)).to.be.true;
});