-
Notifications
You must be signed in to change notification settings - Fork 29.8k
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: add test for failed save in REPL #1818
Conversation
c1ab67f
to
c373204
Compare
Can someone throw this into Jenkins to make sure it actually works for all the operating systems? It should, but uh...you know... |
// make sure I get a failed to save message and not some other error | ||
assert.equal(data, 'Failed to save:' + invalidFileName + '\n'); | ||
// reset to no-op | ||
putIn.write = function() {}; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why do we need this?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We want to test that when the file can't be saved, the REPL reports that to the user rather than (say) failing silently.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It might be clearer and more robust to override fs.writeFileSync()
or whatever so that it triggers an error no matter what. Downside is that ties the test to the REPL implementation a little more closely than one might like.
Pushed commit to change (Unfortunately, the rebase to master means that |
Rebased to get test fix, runs clean now, woot. |
LGTM if the tests pass. |
PR-URL: #1818 Reviewed-By: Chris Dickinson <[email protected]>
Merged in 8ea6844 |
Getting rid of a
TODO
comment (#264)