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