Skip to content

Commit ddc88d6

Browse files
Check realpath when change directory to a directory symbolic link
1 parent c79f239 commit ddc88d6

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

node/test/cd.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ describe('cd cases', () => {
7070
assert.equal(process.cwd(), TEMP_DIR_2_SUBDIR_1);
7171

7272
tl.cd(TEMP_DIR_2_SUBDIR_1_SYMLINK_DIR_1);
73-
assert.equal(process.cwd(), TEMP_DIR_2_SUBDIR_1_SYMLINK_DIR_1);
73+
assert.equal(fs.realpathSync('.'), TEMP_DIR_1);
7474

7575
assert.equal(process.env.OLDPWD, TEMP_DIR_2_SUBDIR_1);
7676

@@ -92,7 +92,7 @@ describe('cd cases', () => {
9292
it('Provide path that is a dir symlink', (done) => {
9393
assert.ok(fs.existsSync(TEMP_DIR_2_SUBDIR_1_SYMLINK_DIR_1));
9494
assert.doesNotThrow(() => tl.cd(TEMP_DIR_2_SUBDIR_1_SYMLINK_DIR_1));
95-
assert.equal(process.cwd(), TEMP_DIR_2_SUBDIR_1_SYMLINK_DIR_1);
95+
assert.equal(fs.realpathSync('.'), TEMP_DIR_1);
9696
done();
9797
});
9898

0 commit comments

Comments
 (0)