Back to Napcraft
SOURCE / PINNED RELEASE

Made of little things.

Napcraft

Release
ee47ac6a25df…
Author-recorded commit
410dea87e109…
License
LICENSE
Author’s source reference
nostr://npub182jczunncwe0jn6frpqwq3e0qjws7yqqnc3auccqv9nte2dnd63scjm4rf/wss%3A%2F%2Fgit.napplet.soy%2F/n-52f9e22f5ce

Archive hash verified: 9e6e0cabb18d0d46…. The source-to-build association is the author’s claim; it has not been independently rebuilt.

tests/persistence.mjs
import {
  chromium,
  executable,
  frameOf,
  approveLocalPrompts,
} from './browser-support.mjs';
import { readFile, writeFile } from 'node:fs/promises';
import assert from 'node:assert/strict';
const saved = JSON.parse(
  await readFile('.napplet-space/persistence-world.json', 'utf8'),
);
const browser = await chromium.launch({
  executablePath: executable,
  headless: true,
});
try {
  const page = await browser.newPage();
  await page.goto(process.env.NAPCRAFT_URL || 'http://127.0.0.1:51696/');
  const stop = approveLocalPrompts(page),
    f = await frameOf(page);
  await f.locator('#join').click();
  await f.locator('#code').fill(saved.code);
  await f.locator('#confirmJoin').click();
  await f.locator('#share').waitFor({ state: 'visible' });
  assert.equal(
    await f.locator('canvas').getAttribute('data-edits'),
    String(saved.edits),
  );
  await writeFile(
    '.napplet-space/restart-persistence.json',
    JSON.stringify({ passed: true, edits: saved.edits }),
  );
  console.log('PASS persisted world and edits after backend process restart');
  stop();
} finally {
  await browser.close();
}