2
0
mirror of https://github.com/frappe/books.git synced 2024-11-08 14:50:56 +00:00
books/tests/testFrappe.spec.ts
18alantom 309c5c7474 refactor: remove util calls from frappe
- shift demux
- fix import
- add init test
2022-05-23 16:18:21 +05:30

32 lines
768 B
TypeScript

import * as assert from 'assert';
import 'mocha';
import { DatabaseManager } from '../backend/database/manager';
import { Frappe } from '../frappe';
describe('Frappe', function () {
const frappe = new Frappe(DatabaseManager);
specify('Init', async function () {
assert.strictEqual(
Object.keys(frappe.schemaMap).length,
0,
'zero schemas one'
);
await frappe.init();
assert.strictEqual(
Object.keys(frappe.schemaMap).length,
0,
'zero schemas two'
);
await frappe.db.createNewDatabase(':memory:');
await frappe.initializeAndRegister({}, true);
assert.strictEqual(
Object.keys(frappe.schemaMap).length > 0,
true,
'non zero schemas'
);
await frappe.db.close();
});
});