Skip to content

Self-hosted, Self-Improving, Federated Everything App — dev management, agent orchestration, persistent mind, digital twin, second brain, and creative pipeline from a single dashboard over Tailscale to port the user into the OS

test: use native realpath for Windows symlink resolution in the workspace-link test (#12633)

[._.]/ Adam Eivy08d9bfcd15e0
diff --git a/scripts/link-worktree-deps.test.js b/scripts/link-worktree-deps.test.js
index 53f01b8eff..8e68845448 100644
--- a/scripts/link-worktree-deps.test.js
+++ b/scripts/link-worktree-deps.test.js
@@ -16,6 +16,7 @@ afterEach(() => {
root = undefined;
});
+// The JS realpath fails with EPERM on Windows symlinks and keeps 8.3 short names; native resolves both.
describe('link-worktree-deps script', () => {
it('links missing dependency dirs from the source checkout and keeps existing ones', () => {
root = mkdtempSync(join(tmpdir(), 'portos-link-worktree-deps-'));
@@ -40,7 +41,7 @@ describe('link-worktree-deps script', () => {
});
it('resolves workspace links inside the worktree, not the source checkout (#12633)', () => {
- root = realpathSync(mkdtempSync(join(tmpdir(), 'portos-link-worktree-deps-')));
+ root = realpathSync.native(mkdtempSync(join(tmpdir(), 'portos-link-worktree-deps-')));
const source = join(root, 'source');
const worktree = join(root, 'worktree');
// Source install: a registry package, a workspace scope next to a registry scope entry, a bin shim.
@@ -64,10 +65,10 @@ describe('link-worktree-deps script', () => {
// Windows reports the recreated relative target with backslashes.
expect(readlinkSync(join(linked, '@acme', 'core')).replaceAll('\\', '/')).toBe('../../packages/core');
expect(readFileSync(join(linked, '@acme', 'core', 'marker.txt'), 'utf8')).toBe('fresh');
- expect(realpathSync(join(linked, '@acme', 'core')).startsWith(worktree)).toBe(true);
+ expect(realpathSync.native(join(linked, '@acme', 'core')).startsWith(worktree)).toBe(true);
// Everything that is not a workspace link still shares the source's install.
- expect(realpathSync(join(linked, 'left-pad'))).toBe(join(modules, 'left-pad'));
- expect(realpathSync(join(linked, '@types'))).toBe(join(modules, '@types'));
+ expect(realpathSync.native(join(linked, 'left-pad'))).toBe(join(modules, 'left-pad'));
+ expect(realpathSync.native(join(linked, '@types'))).toBe(join(modules, '@types'));
expect(existsSync(join(linked, '.bin', 'left-pad'))).toBe(true);
// Already provisioned: a rerun leaves the directory exactly as it was.