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.match;
const now = new Date();
const context = {
field1: "",
field2: "something",
field3: now,
field4: 4,
field5: {value: "something"},
};
describe('Match Validation', () => {
it('should not require a value', () => {
expect(fn('')).to.be.true;
});
it('should return false by default when fields do not match', () => {
expect(fn('something', context, {value: 'field1'})).to.be.false;