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