Skip to content

test: add a test case for the path.posix.resolve - #27905

Merged
ChALkeR merged 1 commit into
nodejs:masterfrom
ShGKme:test-path-resolve
May 27, 2019
Merged

test: add a test case for the path.posix.resolve#27905
ChALkeR merged 1 commit into
nodejs:masterfrom
ShGKme:test-path-resolve

Conversation

@ShGKme

@ShGKme ShGKme commented May 26, 2019

Copy link
Copy Markdown
Contributor

In posix path.resolve should handle relative paths to be safe even if process.cwd fails.

At lib/path.js#999:

    return resolvedPath.length > 0 ? resolvedPath : '.';

Else branch wasn't covered.

Add a test case to cover this.

Checklist

  • make -j4 test (UNIX), or vcbuild test (Windows) passes
  • commit message follows commit guidelines

@nodejs-github-bot nodejs-github-bot added the test Issues and PRs related to Node.js core tests and test infrastructure. label May 26, 2019
Comment thread test/parallel/test-path-resolve.js Outdated

@ryzokuken ryzokuken left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM with Anna's comments addressed, thanks!

@ryzokuken ryzokuken added the code-and-learn Issues related to the Code-and-Learn events and PRs submitted during the events. label May 26, 2019
@nodejs-github-bot

Copy link
Copy Markdown
Collaborator

@nodejs-github-bot

Copy link
Copy Markdown
Collaborator

@gireeshpunathil gireeshpunathil added the author ready PRs with CI started, the required approvals, and no outstanding review comments. label May 27, 2019
@ChALkeR

ChALkeR commented May 27, 2019

Copy link
Copy Markdown
Member

Please react with 👍for fast-tracking.

@ChALkeR ChALkeR added the fast-track PRs proposed for a shorter-than-standard waiting period before landing. label May 27, 2019
In posix path.resolve should handle relative paths to be safe
even if process.cwd fails.

At lib/path.js#999:
    return resolvedPath.length > 0 ? resolvedPath : '.';
Else branch wasn't covered.

Add a test case to cover this.

PR-URL: #27905
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Ujjwal Sharma <usharma1998@gmail.com>
Reviewed-By: Rich Trott <rtrott@gmail.com>
Reviewed-By: Gireesh Punathil <gpunathi@in.ibm.com>
Reviewed-By: Сковорода Никита Андреевич <chalkerx@gmail.com>
@ChALkeR
ChALkeR merged commit e3555e9 into nodejs:master May 27, 2019
@ChALkeR

ChALkeR commented May 27, 2019

Copy link
Copy Markdown
Member

Landed in e3555e9.

Thanks for the contribution! 🎉

https://www.nodetodo.org/next-steps/ is a good list of ideas on possible next steps. (But the next steps are not limited to just that list -- you can always come up with your own)!

targos pushed a commit that referenced this pull request May 28, 2019
In posix path.resolve should handle relative paths to be safe
even if process.cwd fails.

At lib/path.js#999:
    return resolvedPath.length > 0 ? resolvedPath : '.';
Else branch wasn't covered.

Add a test case to cover this.

PR-URL: #27905
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Ujjwal Sharma <usharma1998@gmail.com>
Reviewed-By: Rich Trott <rtrott@gmail.com>
Reviewed-By: Gireesh Punathil <gpunathi@in.ibm.com>
Reviewed-By: Сковорода Никита Андреевич <chalkerx@gmail.com>
@targos targos mentioned this pull request Jun 3, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

author ready PRs with CI started, the required approvals, and no outstanding review comments. code-and-learn Issues related to the Code-and-Learn events and PRs submitted during the events. fast-track PRs proposed for a shorter-than-standard waiting period before landing. test Issues and PRs related to Node.js core tests and test infrastructure.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

7 participants