easily-expect
Version:
You can easily use expect
17 lines (15 loc) • 701 B
JavaScript
/* global describe, it */
const { checkArray } = require('../index')
describe('Test regular expression', () => {
it('Check Strings in Array', () => {
checkArray([/^\d*$/, /[a-z]{1,10}/], ['123', 'a', '123', 'a'], ['123', 'a', '123', 'a'])
})
it('Check Objects in Array', () => {
checkArray([/^\d*$/, /[a-z]{1,10}/, { test1: /^\d*$/ }], ['123', 'a', { test1: '123' }, '123', 'a', { test1: '123' }], ['123', 'a', { test1: '123' }])
})
// Fail
// it('Check Objects in Array', () => {
// checkArray([/^\d*$/, /[a-z]{1,10}/, { test1: /^\d*$/ }], ['123', 'a', { test2: '123' }, '123', 'a', { test1: '123' }], ['123', 'a', { test1: '123f' }])
// })
})