MCPcopy Create free account
hub / github.com/WiseLibs/better-sqlite3 / rejectsWith

Function rejectsWith

test/36.database.backup.js:16–20  ·  view source on GitHub ↗
(type, p)

Source from the content-addressed store, hash-verified

14
15 const fulfillsWith = (value, p) => p.then(v => void expect(v).to.deep.equal(value));
16 const rejectsWith = (type, p) => {
17 const shouldReject = () => { throw new Error('Promise should have been rejected') };
18 const reasonIs = (reason) => { if (!(reason instanceof type)) throw reason; }
19 return p.then(shouldReject, reasonIs);
20 };
21
22 it('should be rejected when destination is not a string', async function () {
23 await rejectsWith(TypeError, this.db.backup());

Callers 1

Calls

no outgoing calls

Tested by

no test coverage detected