(initial = {})
| 44 | } |
| 45 | |
| 46 | function makeStore(initial = {}) { |
| 47 | const state = { ...initial }; |
| 48 | const inbound = []; |
| 49 | const sets = []; |
| 50 | return { |
| 51 | getState: (k) => (state[k] !== undefined ? state[k] : null), |
| 52 | setState: (k, v) => { state[k] = v; sets.push([k, v]); }, |
| 53 | countPending: () => 0, |
| 54 | writeInbound: (event) => { inbound.push(event); }, |
| 55 | writeInboundBatch: () => {}, |
| 56 | _state: state, |
| 57 | _inbound: inbound, |
| 58 | _sets: sets, |
| 59 | }; |
| 60 | } |
| 61 | |
| 62 | function silentLogger() { |
| 63 | const calls = { log: [], warn: [], error: [] }; |
no outgoing calls
no test coverage detected