File tree Expand file tree Collapse file tree 1 file changed +6
-6
lines changed Expand file tree Collapse file tree 1 file changed +6
-6
lines changed Original file line number Diff line number Diff line change @@ -34,20 +34,20 @@ describe("Path Utilities", () => {
3434 } )
3535
3636 it ( "should show relative paths within cwd" , ( ) => {
37- const cwd = "/home/user/project"
38- const filePath = "/home/user/project/src/file.txt"
37+ const cwd = path . resolve ( "/home/user/project" )
38+ const filePath = path . resolve ( "/home/user/project/src/file.txt" )
3939 getReadablePath ( cwd , filePath ) . should . equal ( "src/file.txt" )
4040 } )
4141
4242 it ( "should show basename when path equals cwd" , ( ) => {
43- const cwd = "/home/user/project"
43+ const cwd = path . resolve ( "/home/user/project" )
4444 getReadablePath ( cwd , cwd ) . should . equal ( "project" )
4545 } )
4646
4747 it ( "should show absolute path when outside cwd" , ( ) => {
48- const cwd = "/home/user/project"
49- const filePath = "/home/user/other/file.txt"
50- getReadablePath ( cwd , filePath ) . should . equal ( filePath )
48+ const cwd = path . resolve ( "/home/user/project" )
49+ const filePath = path . resolve ( "/home/user/other/file.txt" )
50+ getReadablePath ( cwd , filePath ) . should . equal ( filePath . toPosix ( ) )
5151 } )
5252 } )
5353} )
You can’t perform that action at this time.
0 commit comments