* @returns {object[]} scrubbed results
*/
static _multiResultLog(results) {
- for (const result of results) {
- delete result._types;
+ if (results) {
+ for (const result of results) {
+ delete result._types;
+ }
}
return results;
}
}); // receive
}); // pgpInitOptions
+ describe('_multiResultLog', function () {
+ it('strips verbosity', function () {
+ const result = DatabasePostgres._multiResultLog(multiResultResponse);
+ assert(!('_types' in result[0]));
+ });
+ it('covers empty', function () {
+ const result = DatabasePostgres._multiResultLog(undefined);
+ assert.strictEqual(result, undefined);
+ });
+ }); // _multiResultLog
+
describe('_tableExists', function () {
beforeEach(function () {
sinon.stub(db.db, 'oneOrNone');