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

Function expectError

test/33.database.aggregate.js:476–482  ·  view source on GitHub ↗
(exception, fn)

Source from the content-addressed store, hash-verified

474 describe('should propagate exceptions', function () {
475 const exceptions = [new TypeError('foobar'), new Error('baz'), { yup: 'ok' }, 'foobarbazqux', '', null, 123.4];
476 const expectError = (exception, fn) => {
477 try { fn(); } catch (ex) {
478 expect(ex).to.equal(exception);
479 return;
480 }
481 throw new TypeError('Expected aggregate to throw an exception');
482 };
483
484 specify('thrown in the start() function', function () {
485 exceptions.forEach((exception, index) => {

Callers 1

Calls 1

fnFunction · 0.70

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…