From fba01fa82e326c17836592efa44e321c33fd38d1 Mon Sep 17 00:00:00 2001 From: Ivan Duplenskikh <115665590+ivanduplenskikh@users.noreply.github.com> Date: Wed, 25 Dec 2024 19:49:53 +0100 Subject: [PATCH] Check realpath when change directory to a directory symbolic link --- node/test/cd.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/node/test/cd.ts b/node/test/cd.ts index b2547c2b7..bf30bfee6 100644 --- a/node/test/cd.ts +++ b/node/test/cd.ts @@ -70,7 +70,7 @@ describe('cd cases', () => { assert.equal(process.cwd(), TEMP_DIR_2_SUBDIR_1); tl.cd(TEMP_DIR_2_SUBDIR_1_SYMLINK_DIR_1); - assert.equal(process.cwd(), TEMP_DIR_2_SUBDIR_1_SYMLINK_DIR_1); + assert.equal(fs.realpathSync('.'), TEMP_DIR_1); assert.equal(process.env.OLDPWD, TEMP_DIR_2_SUBDIR_1); @@ -92,7 +92,7 @@ describe('cd cases', () => { it('Provide path that is a dir symlink', (done) => { assert.ok(fs.existsSync(TEMP_DIR_2_SUBDIR_1_SYMLINK_DIR_1)); assert.doesNotThrow(() => tl.cd(TEMP_DIR_2_SUBDIR_1_SYMLINK_DIR_1)); - assert.equal(process.cwd(), TEMP_DIR_2_SUBDIR_1_SYMLINK_DIR_1); + assert.equal(fs.realpathSync('.'), TEMP_DIR_2_SUBDIR_1_SYMLINK_DIR_1); done(); });