clear caches before test
parent
059917f43d
commit
2916750d6d
|
|
@ -19,4 +19,5 @@ export declare function getWorkOrderMilestoneTypes(): Promise<recordTypes.WorkOr
|
|||
export declare function getWorkOrderMilestoneTypeById(workOrderMilestoneTypeId: number): Promise<recordTypes.WorkOrderMilestoneType | undefined>;
|
||||
export declare function getWorkOrderMilestoneTypeByWorkOrderMilestoneType(workOrderMilestoneTypeString: string): Promise<recordTypes.WorkOrderMilestoneType | undefined>;
|
||||
export declare function preloadCaches(): Promise<void>;
|
||||
export declare function clearCaches(): void;
|
||||
export declare function clearCacheByTableName(tableName: string, relayMessage?: boolean): void;
|
||||
|
|
|
|||
|
|
@ -169,6 +169,14 @@ export async function preloadCaches() {
|
|||
await getWorkOrderTypes();
|
||||
await getWorkOrderMilestoneTypes();
|
||||
}
|
||||
export function clearCaches() {
|
||||
clearLotOccupantTypesCache();
|
||||
clearLotStatusesCache();
|
||||
clearLotTypesCache();
|
||||
clearOccupancyTypesCache();
|
||||
clearWorkOrderTypesCache();
|
||||
clearWorkOrderMilestoneTypesCache();
|
||||
}
|
||||
function clearWorkOrderMilestoneTypesCache() {
|
||||
workOrderMilestoneTypes = undefined;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -308,6 +308,15 @@ export async function preloadCaches(): Promise<void> {
|
|||
await getWorkOrderMilestoneTypes()
|
||||
}
|
||||
|
||||
export function clearCaches(): void {
|
||||
clearLotOccupantTypesCache()
|
||||
clearLotStatusesCache()
|
||||
clearLotTypesCache()
|
||||
clearOccupancyTypesCache()
|
||||
clearWorkOrderTypesCache()
|
||||
clearWorkOrderMilestoneTypesCache()
|
||||
}
|
||||
|
||||
function clearWorkOrderMilestoneTypesCache(): void {
|
||||
workOrderMilestoneTypes = undefined
|
||||
}
|
||||
|
|
|
|||
|
|
@ -16,6 +16,9 @@ describe('config.cemetery.ssm', () => {
|
|||
describe('functions.cache', () => {
|
||||
const badId = -3;
|
||||
const badName = 'qwertyuiopasdfghjklzxcvbnm';
|
||||
before(() => {
|
||||
cacheFunctions.clearCaches();
|
||||
});
|
||||
describe('Lot Occupant Types', () => {
|
||||
it('returns Lot Occupant Types', async () => {
|
||||
cacheFunctions.clearCacheByTableName('LotOccupantTypes');
|
||||
|
|
|
|||
|
|
@ -25,6 +25,10 @@ describe('functions.cache', () => {
|
|||
const badId = -3
|
||||
const badName = 'qwertyuiopasdfghjklzxcvbnm'
|
||||
|
||||
before(() => {
|
||||
cacheFunctions.clearCaches()
|
||||
})
|
||||
|
||||
describe('Lot Occupant Types', () => {
|
||||
it('returns Lot Occupant Types', async () => {
|
||||
cacheFunctions.clearCacheByTableName('LotOccupantTypes')
|
||||
|
|
|
|||
Loading…
Reference in New Issue