MCPcopy Create free account
hub / github.com/Botloader/botloader / testList

Function testList

integration-tests/settings.ts:249–269  ·  view source on GitHub ↗
(expectedValues: any[], input: any[])

Source from the content-addressed store, hash-verified

247 .complete()
248
249function testList(expectedValues: any[], input: any[]) {
250 for (let i = 0; i < expectedValues.length; i++) {
251 const expected = expectedValues[i]
252 const value = input[i]
253 if (!value) {
254 throw new Error(`value at ${i} is false-y`)
255 }
256
257 for (let [k, expectedValue] of Object.entries(expected)) {
258 let valueEntry = (value as any)[k]
259 if (Array.isArray(expectedValue)) {
260 expectedValue = JSON.stringify(expectedValue)
261 valueEntry = JSON.stringify(valueEntry)
262 }
263
264 if (valueEntry !== expectedValue) {
265 throw new Error(`incorrect value at value[${i}][${k}], expected '${expectedValue}' got '${valueEntry}'`)
266 }
267 }
268 }
269}
270
271function testListOptions() {
272 const expectedValues = [{

Callers 4

testListOptionsFunction · 0.85
testStringSelectListsFunction · 0.85
testNumberSelectListsFunction · 0.85
testListDefaultFunction · 0.85

Calls 1

entriesMethod · 0.80

Tested by

no test coverage detected