2
0
mirror of https://github.com/frappe/books.git synced 2024-11-14 01:14:03 +00:00
books/tests/helpers.js
2019-12-10 01:28:18 +05:30

17 lines
410 B
JavaScript

const frappe = require('frappejs');
const server = require('frappejs/server');
const SQLite = require('frappejs/backends/sqlite');
module.exports = {
async initSqlite({ dbPath = '_test.db', models } = {}) {
server.init();
if (models) {
frappe.registerModels(models, 'server');
}
frappe.db = new SQLite({ dbPath });
await frappe.db.connect();
await frappe.db.migrate();
}
};