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