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

Function expectError

test/34.database.table.js:551–557  ·  view source on GitHub ↗
(exception, fn)

Source from the content-addressed store, hash-verified

549 describe('should propagate exceptions', function () {
550 const exceptions = [new TypeError('foobar'), new Error('baz'), { yup: 'ok' }, 'foobarbazqux', '', null, 123.4];
551 const expectError = (exception, fn) => {
552 try { fn(); } catch (ex) {
553 expect(ex).to.equal(exception);
554 return;
555 }
556 throw new TypeError('Expected table to throw an exception');
557 };
558
559 specify('thrown in the factory function', function () {
560 exceptions.forEach((exception, index) => {

Callers 1

Calls 1

fnFunction · 0.70

Tested by

no test coverage detected