Skip to content

Commit 4015790

Browse files
committed
tests: adds mysql.format() coverage
1 parent 9be6991 commit 4015790

File tree

1 file changed

+14
-0
lines changed

1 file changed

+14
-0
lines changed
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
var path = require('path');
2+
var assert = require('assert');
3+
var common = require('../../common');
4+
var lib = require(path.resolve(common.lib, '../index'));
5+
6+
assert.equal(
7+
lib.format('SELECT * FROM ?? WHERE ?? = ?', [ 'table', 'property', 123 ]),
8+
'SELECT * FROM `table` WHERE `property` = 123'
9+
);
10+
11+
assert.equal(
12+
lib.format('INSERT INTO ?? SET ?', [ 'table', { property: 123 } ]),
13+
'INSERT INTO `table` SET `property` = 123'
14+
);

0 commit comments

Comments
 (0)