Skip to content
This repository has been archived by the owner on Mar 15, 2021. It is now read-only.

Use normalize() for consistency in Windows #20

Closed
mscottx88 opened this issue Jul 22, 2017 · 1 comment · Fixed by #33
Closed

Use normalize() for consistency in Windows #20

mscottx88 opened this issue Jul 22, 2017 · 1 comment · Fixed by #33

Comments

@mscottx88
Copy link

The method getFullPath() does not take into consideration Win32 environments with mixed Posix style require strings.

For instance:

mockRequire(process.cwd() + "/" + path, obj);

In Posix environment the backslash remains, but in Win32 environment, the backslash becomes a forward slash "".

To overcome, wrap the result of getFullPath() with a call to normalize(), exposed by the path module.

@tiagomapmarques
Copy link
Contributor

@mscottx88, was #33 what you had in mind?

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants