Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions electron/source-ledger.cjs
Original file line number Diff line number Diff line change
Expand Up @@ -213,6 +213,7 @@ async function buildSourceLedger(inventory, downloadRoots, options = {}) {
'credential-or-browser-state',
'cache-log-or-backup-directory',
'runtime-log-or-cache',
'regenerable-python-bytecode',
'mod-directory-inventoried-separately',
'profiles-inventoried-separately',
'overwrite-inventoried-separately',
Expand Down
16 changes: 16 additions & 0 deletions tests/installed-inventory.test.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@ import crypto from 'node:crypto';
import { createRequire } from 'node:module';
const require = createRequire(import.meta.url);
const { inspectMo2 } = require('../electron/installed-inventory.cjs');
const { buildSourceLedger } = require('../electron/source-ledger.cjs');
const { mapArchiveSources } = require('../electron/archive-mapping.cjs');
function fixture() {
const root = fs.mkdtempSync(path.join(os.tmpdir(), 'loadstone-inventory-'));
for (const dir of [
Expand Down Expand Up @@ -352,6 +354,20 @@ test('instance inventory excludes regenerable Python plugin caches while retaini
`fixture: ${file}`,
);
}
const ledger = await buildSourceLedger(report, []);
assert.deepEqual(ledger.installation, report.installation);
assert.deepEqual(ledger.exclusions, report.exclusions);
const mapped = await mapArchiveSources(ledger);
assert.deepEqual(mapped.installation, report.installation);
assert.deepEqual(mapped.exclusions, report.exclusions);
assert.equal(mapped.installable, false);
assert.equal(mapped.publicationApproved, false);
const unsupported = structuredClone(report);
unsupported.exclusions[0].reason = 'unknown-exclusion';
await assert.rejects(
buildSourceLedger(unsupported, []),
/Invalid inventory exclusion record/,
);
await assert.rejects(
inspectMo2(f.root, {
hashFiles: true,
Expand Down
Loading