UNPKG

@sprucelabs/schema

Version:

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

14 lines (13 loc) • 601 B
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); const test_utils_1 = require("@sprucelabs/test-utils"); const selectAssert = { assertSelectChoicesMatch(choices, expected) { test_utils_1.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(); test_utils_1.assert.isEqualDeep(actualValues, expected, `The options you sent don't match!`); }, }; exports.default = selectAssert;