mirror of
https://github.com/frappe/books.git
synced 2024-11-08 14:50:56 +00:00
309c5c7474
- shift demux - fix import - add init test
32 lines
768 B
TypeScript
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();
|
|
});
|
|
});
|