Skip to content

Commit 21c4691

Browse files
committed
*tests
1 parent 7442de2 commit 21c4691

File tree

2 files changed

+8
-2
lines changed

2 files changed

+8
-2
lines changed

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
"description": "✔ MySQL2 upgrade: cache queries, easy shortcuts, logging and debugging.",
55
"main": "index.js",
66
"scripts": {
7-
"test": "DEBUG=* node ./test/test.js"
7+
"test": "node ./test/test.js"
88
},
99
"repository": {
1010
"type": "git",

test/test.js

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
// @todo Node default test runner
12
const mysql = require('../index.js')
23
// https://github.com/sidorares/node-mysql2/blob/master/examples/server.js
34
const server = mysql.createServer()
@@ -60,7 +61,12 @@ const db = mysql.connect()
6061
db.q('SELECT * FROM test_table').then(res => console.dir)
6162
db.q('SELECT * FROM test_table', {}, true).then((res) => {
6263
db.q('SELECT * FROM test_table', {}, true).then((res) => {
64+
server.close()
6365
process.exit(0)
6466
})
65-
console.dir(res)
67+
console.log('✅ ', res)
68+
})
69+
70+
process.on('exit', code => {
71+
console.log(`About to exit with code: ${code}`)
6672
})

0 commit comments

Comments
 (0)