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

test: fix test-cli-permission tests when cwd contains /tmp #54188

Merged
merged 2 commits into from
Aug 14, 2024

Commits on Aug 3, 2024

  1. test: use relative paths in test-cli-permission tests

    `process.permission.has("fs")` checks if the process has permission
    for all files under `cwd`. Granting permission for `/tmp` and running
    tests with `cwd` containing `/tmp` will make the funtion return
    `true`, differing from expected results. Using relative paths ensures
    test paths are not `cwd` itself.
    
    Fixes: nodejs#54021
    sendoru committed Aug 3, 2024
    Configuration menu
    Copy the full SHA
    effea4b View commit details
    Browse the repository at this point in the history
  2. test: skip the last test case when /tmp is firstPath

    Differing from the other subdirectories of `/` `/tmp` has rwx
    permissions for all users. In the case where `firstPath` is `/tmp`,
    the last test case will fail, as it expects granting permission to
    `firstPath` will be failed. This commit skips the last test case when
    `firstPath` is `/tmp`.
    
    Fixes: nodejs#54021
    sendoru committed Aug 3, 2024
    Configuration menu
    Copy the full SHA
    615b1b7 View commit details
    Browse the repository at this point in the history