import test from 'node:test'; import assert from 'node:assert/strict'; import fs from 'node:fs/promises'; test('runtime menu config is seeded once in persistent data and never overwritten', async () => { const entrypoint = await fs.readFile(new URL('../runtime/entrypoint.sh', import.meta.url), 'utf8'); const existenceGuard = entrypoint.indexOf('if [ ! -e "$navigation_config_file" ]; then'); const copy = entrypoint.indexOf('cp "$core_root/resources/navigation.json" "$navigation_config_file"'); assert.ok(existenceGuard >= 0, 'persistent navigation config must have an existence guard'); assert.ok(copy > existenceGuard, 'the default config must only be copied inside that guard'); assert.equal(entrypoint.indexOf('cp -f "$core_root/resources/navigation.json"'), -1); });