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-repl-require-after-write #27088

Closed
wants to merge 4 commits into from

Conversation

targos
Copy link
Member

@targos targos commented Apr 4, 2019

Currently, the test creates a file in the cwd and doesn't clean it up.
Use a temporary directory instead.

Currently, the test creates a file in the cwd and doesn't clean it up.
Use a temporary directory instead.
@targos targos added the test Issues and PRs related to the tests. label Apr 4, 2019
@targos targos requested a review from BridgeAR April 4, 2019 15:34
@nodejs-github-bot
Copy link
Collaborator

Copy link
Member

@BridgeAR BridgeAR left a comment

Choose a reason for hiding this comment

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

Thanks!

@BridgeAR
Copy link
Member

BridgeAR commented Apr 4, 2019

I would like to fast-track this. Please +1 if you're fine with that.

@BridgeAR BridgeAR added the fast-track PRs that do not need to wait for 48 hours to land. label Apr 4, 2019
@nodejs-github-bot
Copy link
Collaborator

@BridgeAR BridgeAR added the author ready PRs that have at least one approval, no pending requests for changes, and a CI started. label Apr 4, 2019
@targos
Copy link
Member Author

targos commented Apr 4, 2019

I just pushed a fix (forgot a slash)


tmpdir.refresh();

const requirePath = tmpdir.path + '/non-existent.json';
Copy link
Member

Choose a reason for hiding this comment

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

Nit: path.join()?

@nodejs-github-bot
Copy link
Collaborator

@nodejs-github-bot
Copy link
Collaborator

@nodejs-github-bot
Copy link
Collaborator

@nodejs-github-bot
Copy link
Collaborator

@targos
Copy link
Member Author

targos commented Apr 6, 2019

what am I missing with tmpdir on Windows?

@richardlau
Copy link
Member

  • "> Thrown:\n{ Error: ENOENT: no such file or directory, open 'c:workspace\node-test-binary-windows\test.tmp.0\non-existent.json'\n at Object.openSync (fs.js:455:3)\n at Object.writeFileSync (fs.js:1248:35)\n errno: -4058,\n syscall: 'open',\n code: 'ENOENT',\n path:\n 'c:workspace\node-test-binary-windows\test.tmp.0\non-existent.json' }\n> "
  • '> 1\n> '

Looks like something has happened to the \ after c:. A recent regression?

@targos
Copy link
Member Author

targos commented Apr 6, 2019

Thanks @richardlau I think I know what it is now. Since I'm injecting the value in a string literal, the \ acts as an escape character.

@nodejs-github-bot
Copy link
Collaborator

@nodejs-github-bot
Copy link
Collaborator

@addaleax
Copy link
Member

addaleax commented Apr 6, 2019

Landed in 58aaf58, thanks for the PR!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
author ready PRs that have at least one approval, no pending requests for changes, and a CI started. fast-track PRs that do not need to wait for 48 hours to land. test Issues and PRs related to the tests.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

9 participants