| 1 | import test from "node:test"; |
| 2 | import assert from "node:assert/strict"; |
| 3 | import { diffSettings } from "../../shared/definitions/worldSettings.js"; |
| 4 | |
| 5 | test("settings diffs only mention keys that actually changed", () => |
| 6 | { |
| 7 | const { bullets, changed } = diffSettings( |
| 8 | { walkTilesPerSecond: 2, nightDarkness: 0.72 }, |
| 9 | { walkTilesPerSecond: 3, nightDarkness: 0.72, extra: 1 } |
| 10 | ); |
| 11 | assert.deepEqual(changed, { walkTilesPerSecond: 3 }); |
| 12 | assert.equal(bullets.length, 1); |
| 13 | assert.match(bullets[0], /Walk speed/); |
| 14 | assert.match(bullets[0], /2/); |
| 15 | assert.match(bullets[0], /3/); |
| 16 | }); |