UNPKG

@sprucelabs/schema

Version:

Static and dynamic binding plus runtime validation and transformation to ensure your app is sound. 🤓

12 lines (11 loc) • 488 B
import { assert } from '@sprucelabs/test-utils'; const selectAssert = { assertSelectChoicesMatch(choices, expected) { assert.isEqual(choices.length, expected.length, `Expected ${expected.length} choices, but found ${choices.length}!`); const actualValues = choices.map((c) => c.value); actualValues.sort(); expected.sort(); assert.isEqualDeep(actualValues, expected, `The options you sent don't match!`); }, }; export default selectAssert;