2
0
mirror of https://github.com/frappe/books.git synced 2024-12-26 20:30:25 +00:00
books/tests/helpers.js
2018-03-05 22:15:21 +05:30

15 lines
394 B
JavaScript

const server = require('frappejs/server');
const frappe = require('frappejs');
module.exports = {
async initSqlite({dbPath = '_test.db', models} = {}) {
server.init();
if (models) {
frappe.registerModels(models, 'server');
}
await server.initDb({
backend: 'sqlite',
connectionParams: {dbPath: dbPath},
});
}
}