refactor(db): 重构测试数据库路径加载方式
- 更新 .gitignore 文件,忽略数据库文件 - 修改 test_db.js 文件,使用相对路径获取数据库文件
This commit is contained in:
parent
66adc1d6db
commit
c7ac1202c6
1
.gitignore
vendored
1
.gitignore
vendored
@ -1,6 +1,7 @@
|
||||
.*
|
||||
!.gitignore
|
||||
*-*/
|
||||
*.db
|
||||
node_modules/
|
||||
test/
|
||||
package-lock.json
|
@ -1,6 +1,7 @@
|
||||
const betterSqlite3DB = require('db_utils');
|
||||
const betterSqlite3DB = require('./db_utils');
|
||||
const path = require('path');
|
||||
|
||||
const db_path = utils.path.join('.', 'sqlite3.db');
|
||||
const db_path = path.join(__dirname, 'sqlite3.db');
|
||||
const db = new betterSqlite3DB(db_path, null);
|
||||
|
||||
db.createTable('test', [
|
||||
|
Loading…
x
Reference in New Issue
Block a user