2018-01-16 11:39:17 +05:30
|
|
|
const server = require('frappejs/server');
|
2018-02-16 18:43:46 +05:30
|
|
|
const frappe = require('frappejs');
|
2018-01-12 17:55:07 +05:30
|
|
|
|
|
|
|
module.exports = {
|
2018-02-16 18:43:46 +05:30
|
|
|
async initSqlite({dbPath = '_test.db', models} = {}) {
|
2018-01-24 17:22:05 +05:30
|
|
|
server.init();
|
2018-02-16 18:43:46 +05:30
|
|
|
if (models) {
|
2018-03-05 22:15:21 +05:30
|
|
|
frappe.registerModels(models, 'server');
|
2018-02-16 18:43:46 +05:30
|
|
|
}
|
|
|
|
await server.initDb({
|
2018-01-12 17:55:07 +05:30
|
|
|
backend: 'sqlite',
|
2018-02-16 18:43:46 +05:30
|
|
|
connectionParams: {dbPath: dbPath},
|
2018-01-12 17:55:07 +05:30
|
|
|
});
|
|
|
|
}
|
|
|
|
}
|