mirror of
https://github.com/bigcapitalhq/bigcapital.git
synced 2026-02-10 09:52:00 +00:00
40 lines
698 B
JavaScript
40 lines
698 B
JavaScript
import {
|
|
request,
|
|
expect,
|
|
createTenantFactory,
|
|
createTenant,
|
|
bindTenantModel,
|
|
login,
|
|
systemFactory,
|
|
dropTenant,
|
|
} from '~/testInit';
|
|
import CacheService from '@/services/Cache';
|
|
|
|
let tenantWebsite;
|
|
let tenantFactory;
|
|
let loginRes;
|
|
|
|
beforeEach(async () => {
|
|
tenantWebsite = await createTenant();
|
|
tenantFactory = createTenantFactory(tenantWebsite.tenantDb);
|
|
|
|
bindTenantModel(tenantWebsite.tenantDb);
|
|
loginRes = await login(tenantWebsite);
|
|
|
|
CacheService.flush();
|
|
});
|
|
|
|
afterEach(async () => {
|
|
await dropTenant(tenantWebsite);
|
|
|
|
loginRes = null;
|
|
tenantFactory = null;
|
|
tenantWebsite = null;
|
|
});
|
|
|
|
export {
|
|
tenantWebsite,
|
|
tenantFactory,
|
|
systemFactory,
|
|
loginRes,
|
|
}; |