Skip to content

Commit 2e95b0e

Browse files
ALJCepedaFishrock123
authored andcommitted
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: #4640 PR-URL: #8756 Reviewed-By: Ilkka Myller <[email protected]> Reviewed-By: Jeremiah Senkpiel <[email protected]>
1 parent 76fd7db commit 2e95b0e

File tree

1 file changed

+3
-13
lines changed

1 file changed

+3
-13
lines changed

test/parallel/test-repl-persistent-history.js

+3-13
Original file line numberDiff line numberDiff line change
@@ -139,17 +139,7 @@ const tests = [
139139
test: [UP, CLEAR, '\'42\'', ENTER],
140140
expected: [prompt, convertMsg, prompt, prompt + '\'=^.^=\'', prompt, '\'',
141141
'4', '2', '\'', '\'42\'\n', prompt, prompt],
142-
after: function ensureHistoryFixture() {
143-
// XXX(Fishrock123) Make sure nothing weird happened to our fixture
144-
// or it's temporary copy.
145-
// Sometimes this test used to erase the fixture and I'm not sure why.
146-
const history = fs.readFileSync(historyFixturePath, 'utf8');
147-
assert.strictEqual(history,
148-
'\'you look fabulous today\'\n\'Stay Fresh~\'\n');
149-
const historyCopy = fs.readFileSync(historyPath, 'utf8');
150-
assert.strictEqual(historyCopy, '\'you look fabulous today\'' + os.EOL +
151-
'\'Stay Fresh~\'' + os.EOL);
152-
}
142+
clean: false
153143
},
154144
{ // Requires the above testcase
155145
env: {},
@@ -229,7 +219,7 @@ function runTest(assertCleaned) {
229219
const env = opts.env;
230220
const test = opts.test;
231221
const expected = opts.expected;
232-
const after = opts.after;
222+
const clean = opts.clean;
233223
const before = opts.before;
234224

235225
if (before) before();
@@ -275,7 +265,7 @@ function runTest(assertCleaned) {
275265
});
276266

277267
function onClose() {
278-
const cleaned = after ? after() : cleanupTmpFile();
268+
const cleaned = clean === false ? false : cleanupTmpFile();
279269

280270
try {
281271
// Ensure everything that we expected was output

0 commit comments

Comments
 (0)