From 1334828bec6399ca0171e95fe4d2e36fd9236ab5 Mon Sep 17 00:00:00 2001 From: jannyHou Date: Wed, 3 Jul 2019 14:10:24 -0400 Subject: [PATCH] fixup!: fix dbb --- setup.sh | 2 +- test/init.js | 6 +++++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/setup.sh b/setup.sh index 1801fbc..6b05257 100755 --- a/setup.sh +++ b/setup.sh @@ -50,7 +50,7 @@ printf "\n${CYAN}Clean up complete.${PLAIN}\n" ## Pin mysql docker image to version as `mysql` node.js driver does not support v8 yet ## See https://github.com/mysqljs/mysql/issues/2002 -DOCKER_IMAGE=mysql:5.7.22 +DOCKER_IMAGE=mysql:latest ## pull latest mysql image printf "\n${RED}>> Pulling ${DOCKER_IMAGE} image${PLAIN} ${GREEN}...${PLAIN}" diff --git a/test/init.js b/test/init.js index 64fdb26..01682db 100644 --- a/test/init.js +++ b/test/init.js @@ -28,9 +28,13 @@ global.getConfig = function(options) { return dbConf; }; +let db; global.getDataSource = global.getSchema = function(options, customClass) { const ctor = customClass || DataSource; - const db = new ctor(require('../'), global.getConfig(options)); + db = new ctor(require('../'), global.getConfig(options)); + db.log = function(a) { + console.log(a); + } // var db = new DataSource(require('../'), global.getConfig(options)); return db; };