(name, exception)
| 103 | }); |
| 104 | it('should propagate exceptions thrown in the registered function', function () { |
| 105 | const expectError = (name, exception) => { |
| 106 | this.db.function(name, () => { throw exception; }); |
| 107 | try { |
| 108 | this.get(name + '()'); |
| 109 | } catch (ex) { |
| 110 | expect(ex).to.equal(exception); |
| 111 | return; |
| 112 | } |
| 113 | throw new TypeError('Expected function to throw an exception'); |
| 114 | }; |
| 115 | expectError('a', new TypeError('foobar')); |
| 116 | expectError('b', new Error('baz')); |
| 117 | expectError('c', { yup: 'ok' }); |
no outgoing calls
no test coverage detected