test(handoff): preserve native results in bounded attachment projections

This commit is contained in:
cesnimda
2026-10-29 18:55:20 +01:00
parent 657db9d294
commit c16a66e2c8
4 changed files with 14 additions and 4 deletions
@@ -8,7 +8,10 @@ import { fileURLToPath } from 'node:url';
import { validatePackage } from './verify.mjs';
const directory = path.dirname(fileURLToPath(import.meta.url));
const artifactRoot = path.resolve(directory, '../../../../.artifacts');
const repository = fs.realpathSync(path.resolve(directory, '../../../..'));
const artifactRoot = path.join(repository, '.artifacts');
fs.mkdirSync(artifactRoot, { recursive: true });
assert.ok(fs.realpathSync(artifactRoot).startsWith(repository + path.sep));
const hash = bytes => crypto.createHash('sha256').update(bytes).digest('hex');
function shadow(change) {
const temporary = fs.mkdtempSync(path.join(artifactRoot, 'handoff-verify-'));
@@ -17,7 +20,7 @@ function shadow(change) {
change(temporary);
assert.throws(() => validatePackage(temporary));
} finally {
const resolved = path.resolve(temporary);
const resolved = fs.realpathSync(temporary);
assert.ok(resolved.startsWith(artifactRoot + path.sep) && path.basename(resolved).startsWith('handoff-verify-'));
fs.rmSync(resolved, { recursive: true });
}