Files
mtusi2026lab6/student-tests/grafana-scheduler.test.ts
T

5 lines
607 B
TypeScript

import{test,expect}from'bun:test';import{validateGrafanaRuleIntervals}from'../scripts/lib/grafana-scheduler';
test('rejects actual provisioning failure1s under native13.3.1 scheduler10s',()=>{expect(()=>validateGrafanaRuleIntervals([{interval:'1s'}],10)).toThrow();});
test('rejects zero and nonmultiple intervals before native startup',()=>{for(const interval of['0s','15s','unknown'])expect(()=>validateGrafanaRuleIntervals([{interval}],10)).toThrow();});
test('accepts native10s and its20s multiple',()=>{expect(()=>validateGrafanaRuleIntervals([{interval:'10s'},{interval:'20s'}],10)).not.toThrow();});