Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Replace PATH_KEY with pathKey(), delete fixtureEnv #3

Merged
merged 2 commits into from
Dec 28, 2023
Merged

Commits on Dec 28, 2023

  1. Replace PATH_KEY with pathKey(), delete fixtureEnv

    The original motivation was the loss of branch coverage from the
    PATH_KEY initialization expression only ever following one branch. But
    it also made the getPath.test.js tests more self-documenting.
    
    The same goes for hoisting the logic of the former fixtureEnv() helper
    into the getPath test fixture itself. Also, today I learned two things:
    
    1. Forward slashes are legal Windows path separators, per:
       https://stackoverflow.com/a/63251716
    
    2. Node's path.join() will convert any forward slashes in any of its
       arguments to backslashes on Windows:
    
       ```pwsh
       > node -e "console.log(path.join('foo/bar\baz/quux', 'xyzzy/plugh'))"
       foo\baaz\quux\xyzzy\plugh
       ```
    
    Hence the replacement of path.join(...) with plain 'usr/local/bin', etc.
    mbland committed Dec 28, 2023
    Configuration menu
    Copy the full SHA
    82d7b06 View commit details
    Browse the repository at this point in the history
  2. Refactor getPath.test, fix "Windows failure

    On Windows, the "rejects when command isn't found" case failed because
    the message contained "nonexistent.CMD" instead of plain "nonexistent".
    
    In the process of fixing it, I decided to add the makeEnv() test helper
    to make the test cases a little more concise and readable.
    mbland committed Dec 28, 2023
    Configuration menu
    Copy the full SHA
    c3e1c37 View commit details
    Browse the repository at this point in the history