test: use BDD markers in pruneRecentSyntheticIdles test
This commit is contained in:
@@ -4,20 +4,20 @@ import { pruneRecentSyntheticIdles } from "./recent-synthetic-idles"
|
||||
|
||||
describe("pruneRecentSyntheticIdles", () => {
|
||||
it("removes entries older than dedup window", () => {
|
||||
// given
|
||||
//#given
|
||||
const recentSyntheticIdles = new Map<string, number>([
|
||||
["ses_old", 1000],
|
||||
["ses_new", 1600],
|
||||
])
|
||||
|
||||
// when
|
||||
//#when
|
||||
pruneRecentSyntheticIdles({
|
||||
recentSyntheticIdles,
|
||||
now: 2000,
|
||||
dedupWindowMs: 500,
|
||||
})
|
||||
|
||||
// then
|
||||
//#then
|
||||
expect(recentSyntheticIdles.has("ses_old")).toBe(false)
|
||||
expect(recentSyntheticIdles.has("ses_new")).toBe(true)
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user