(options = { delayMs: DELAY_MS, minVisibleMs: MIN_VISIBLE_MS })
| 12 | const MIN_VISIBLE_MS = 1500 |
| 13 | |
| 14 | function setup(options = { delayMs: DELAY_MS, minVisibleMs: MIN_VISIBLE_MS }) { |
| 15 | const states: boolean[] = [] |
| 16 | let active = false |
| 17 | const controller = createStableFlagController((next) => { |
| 18 | active = next |
| 19 | states.push(next) |
| 20 | }, options) |
| 21 | return { |
| 22 | controller, |
| 23 | states, |
| 24 | get active() { |
| 25 | return active |
| 26 | }, |
| 27 | } |
| 28 | } |
| 29 | |
| 30 | describe('createStableFlagController', () => { |
| 31 | beforeEach(() => { |
no test coverage detected