// First require your DOM emulation file (see below)
require('./emulateDom.js');

import db_config from '../knexfile';

let exec_env = process.env.DB_ENV || 'test';
global.$dbConfig = db_config[exec_env];

@@ -198,8 +198,40 @@
 c_env%5D;%0A
+%0Aprocess.env.NODE_ENV = 'test';%0A

Redefine NODE_ENV for tests