test(handoff): preserve native results in bounded attachment projections
This commit is contained in:
@@ -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 });
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user