2
0
mirror of https://github.com/frappe/books.git synced 2024-11-10 15:50:56 +00:00
books/tests/helpers.js

15 lines
394 B
JavaScript
Raw Normal View History

2018-01-16 06:09:17 +00:00
const server = require('frappejs/server');
const frappe = require('frappejs');
2018-01-12 12:25:07 +00:00
module.exports = {
async initSqlite({dbPath = '_test.db', models} = {}) {
2018-01-24 11:52:05 +00:00
server.init();
if (models) {
2018-03-05 16:45:21 +00:00
frappe.registerModels(models, 'server');
}
await server.initDb({
2018-01-12 12:25:07 +00:00
backend: 'sqlite',
connectionParams: {dbPath: dbPath},
2018-01-12 12:25:07 +00:00
});
}
}