(what, expected, actual)
| 44 | }; |
| 45 | const check = (what, condition, detail) => (condition ? ok(what) : bad(what, detail)); |
| 46 | const same = (what, expected, actual) => |
| 47 | check( |
| 48 | what, |
| 49 | JSON.stringify(expected) === JSON.stringify(actual), |
| 50 | `expected ${JSON.stringify(expected)}, got ${JSON.stringify(actual)}`, |
| 51 | ); |
| 52 | |
| 53 | const sleep = (ms) => new Promise((resolve) => setTimeout(resolve, ms)); |
| 54 |