MCPcopy
hub / github.com/WiseLibs/better-sqlite3 / shouldHave

Function shouldHave

test/23.statement.iterate.js:84–100  ·  view source on GitHub ↗
(desiredData)

Source from the content-addressed store, hash-verified

82 });
83 it('should obey the current pluck and expand settings', function () {
84 const shouldHave = (desiredData) => {
85 let i = 0;
86 for (const data of stmt.iterate()) {
87 i += 1;
88 if (typeof desiredData === 'object' && desiredData !== null) {
89 if (Array.isArray(desiredData)) {
90 desiredData[1] = i;
91 } else if (typeof desiredData.entries === 'object' && desiredData.entries !== null) {
92 desiredData.entries.b = i;
93 } else {
94 desiredData.b = i;
95 }
96 }
97 expect(data).to.deep.equal(desiredData);
98 }
99 expect(i).to.equal(10);
100 };
101 const expanded = {
102 entries: { a: 'foo', b: 1, c: 3.14, d: Buffer.alloc(4).fill(0xdd), e: null },
103 $: { c: 5.5 },

Callers 1

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…