test: fixed FIXME in test-repl-persistent-history
When NODE_REPL_HISTORY isn't defined `repl` defaults to temporary file This prevents the temporary file from being cleared and removes check on fixture Refs: https://github.com/nodejs/node/issues/4640 PR-URL: https://github.com/nodejs/node/pull/8756 Reviewed-By: Ilkka Myller <ilkka.myller@nodefield.com> Reviewed-By: Jeremiah Senkpiel <fishrock123@rocketmail.com>
This commit is contained in:
parent
7561123a9f
commit
8e81e91c55
@ -139,17 +139,7 @@ const tests = [
|
|||||||
test: [UP, CLEAR, '\'42\'', ENTER],
|
test: [UP, CLEAR, '\'42\'', ENTER],
|
||||||
expected: [prompt, convertMsg, prompt, prompt + '\'=^.^=\'', prompt, '\'',
|
expected: [prompt, convertMsg, prompt, prompt + '\'=^.^=\'', prompt, '\'',
|
||||||
'4', '2', '\'', '\'42\'\n', prompt, prompt],
|
'4', '2', '\'', '\'42\'\n', prompt, prompt],
|
||||||
after: function ensureHistoryFixture() {
|
clean: false
|
||||||
// XXX(Fishrock123) Make sure nothing weird happened to our fixture
|
|
||||||
// or it's temporary copy.
|
|
||||||
// Sometimes this test used to erase the fixture and I'm not sure why.
|
|
||||||
const history = fs.readFileSync(historyFixturePath, 'utf8');
|
|
||||||
assert.strictEqual(history,
|
|
||||||
'\'you look fabulous today\'\n\'Stay Fresh~\'\n');
|
|
||||||
const historyCopy = fs.readFileSync(historyPath, 'utf8');
|
|
||||||
assert.strictEqual(historyCopy, '\'you look fabulous today\'' + os.EOL +
|
|
||||||
'\'Stay Fresh~\'' + os.EOL);
|
|
||||||
}
|
|
||||||
},
|
},
|
||||||
{ // Requires the above testcase
|
{ // Requires the above testcase
|
||||||
env: {},
|
env: {},
|
||||||
@ -229,7 +219,7 @@ function runTest(assertCleaned) {
|
|||||||
const env = opts.env;
|
const env = opts.env;
|
||||||
const test = opts.test;
|
const test = opts.test;
|
||||||
const expected = opts.expected;
|
const expected = opts.expected;
|
||||||
const after = opts.after;
|
const clean = opts.clean;
|
||||||
const before = opts.before;
|
const before = opts.before;
|
||||||
|
|
||||||
if (before) before();
|
if (before) before();
|
||||||
@ -275,7 +265,7 @@ function runTest(assertCleaned) {
|
|||||||
});
|
});
|
||||||
|
|
||||||
function onClose() {
|
function onClose() {
|
||||||
const cleaned = after ? after() : cleanupTmpFile();
|
const cleaned = clean === false ? false : cleanupTmpFile();
|
||||||
|
|
||||||
try {
|
try {
|
||||||
// Ensure everything that we expected was output
|
// Ensure everything that we expected was output
|
||||||
|
Loading…
x
Reference in New Issue
Block a user