Skip to content

Commit

Permalink
Check realpath when change directory to a directory symbolic link
Browse files Browse the repository at this point in the history
  • Loading branch information
ivanduplenskikh committed Dec 25, 2024
1 parent c79f239 commit fba01fa
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions node/test/cd.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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);

Expand All @@ -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();
});

Expand Down

0 comments on commit fba01fa

Please sign in to comment.