-
-
Notifications
You must be signed in to change notification settings - Fork 88
Open
Description
Hi! Is it possible to validate all group?
For example
import { create, test, each, enforce, group } from 'vest';
/*
data.fields = [
{
name: 'GameBoy Color',
price: 200,
id: "gb-color"
},
{
name: 'GameBoy Advance',
price: 300,
id: "gb-advance"
},
{
name: 'Nintendo 64',
price: 400,
id: "n64"
},
]
*/
const suite = create((data = {}) => {
group("myAwesomeGroup", () => {
each(data.fields, field => {
test(
field.name,
"item price must be greater than 0",
() => { enforce(field.price).isNumeric().greaterThan(0)},
field.id,
)
})
})
})
and after it call something like suit.validate("myAwesomeGroup")
Metadata
Metadata
Assignees
Labels
No labels