@@ -51,14 +51,32 @@ ActionStream.prototype.readable = true;
51
51
const UP = { name : 'up' } ;
52
52
const ENTER = { name : 'enter' } ;
53
53
const CLEAR = { ctrl : true , name : 'u' } ;
54
+
55
+ // File paths
56
+ const fixtures = common . fixturesDir ;
57
+ const historyFixturePath = path . join ( fixtures , '.node_repl_history' ) ;
58
+ const historyPath = path . join ( common . tmpDir , '.fixture_copy_repl_history' ) ;
59
+ const historyPathFail = path . join ( common . tmpDir , '.node_repl\u0000_history' ) ;
60
+ const oldHistoryPathObj = path . join ( fixtures ,
61
+ 'old-repl-history-file-obj.json' ) ;
62
+ const oldHistoryPathFaulty = path . join ( fixtures ,
63
+ 'old-repl-history-file-faulty.json' ) ;
64
+ const oldHistoryPath = path . join ( fixtures , 'old-repl-history-file.json' ) ;
65
+ const enoentHistoryPath = path . join ( fixtures , 'enoent-repl-history-file.json' ) ;
66
+ const emptyHistoryPath = path . join ( fixtures , '.empty-repl-history-file' ) ;
67
+ const defaultHistoryPath = path . join ( common . tmpDir , '.node_repl_history' ) ;
68
+ const emptyHiddenHistoryPath = path . join ( fixtures ,
69
+ '.empty-hidden-repl-history-file' ) ;
70
+ const devNullHistoryPath = path . join ( common . tmpDir ,
71
+ '.dev-null-repl-history-file' ) ;
54
72
// Common message bits
55
73
const prompt = '> ' ;
56
74
const replDisabled = '\nPersistent history support disabled. Set the ' +
57
75
'NODE_REPL_HISTORY environment\nvariable to a valid, ' +
58
76
'user-writable path to enable.\n' ;
59
77
const convertMsg = '\nConverted old JSON repl history to line-separated ' +
60
78
'history.\nThe new repl history file can be found at ' +
61
- `${ path . join ( common . tmpDir , '.node_repl_history' ) } .\n` ;
79
+ `${ defaultHistoryPath } .\n` ;
62
80
const homedirErr = '\nError: Could not get the home directory.\n' +
63
81
'REPL session history will not be persisted.\n' ;
64
82
const replFailedRead = '\nError: Could not open history file.\n' +
@@ -71,25 +89,8 @@ const oldHistoryObj = '\nError: The old history file data has to be an Array' +
71
89
'.\nREPL session history will not be persisted.\n' ;
72
90
const sameHistoryFilePaths = '\nThe old repl history file has the same name ' +
73
91
'and location as the new one i.e., ' +
74
- path . join ( common . tmpDir , '.node_repl_history' ) +
92
+ ` ${ defaultHistoryPath } ` +
75
93
' and is empty.\nUsing it as is.\n' ;
76
- // File paths
77
- const fixtures = common . fixturesDir ;
78
- const historyFixturePath = path . join ( fixtures , '.node_repl_history' ) ;
79
- const historyPath = path . join ( common . tmpDir , '.fixture_copy_repl_history' ) ;
80
- const historyPathFail = path . join ( common . tmpDir , '.node_repl\u0000_history' ) ;
81
- const oldHistoryPathObj = path . join ( fixtures ,
82
- 'old-repl-history-file-obj.json' ) ;
83
- const oldHistoryPathFaulty = path . join ( fixtures ,
84
- 'old-repl-history-file-faulty.json' ) ;
85
- const oldHistoryPath = path . join ( fixtures , 'old-repl-history-file.json' ) ;
86
- const enoentHistoryPath = path . join ( fixtures , 'enoent-repl-history-file.json' ) ;
87
- const emptyHistoryPath = path . join ( fixtures , '.empty-repl-history-file' ) ;
88
- const defaultHistoryPath = path . join ( common . tmpDir , '.node_repl_history' ) ;
89
- const emptyHiddenHistoryPath = path . join ( fixtures ,
90
- '.empty-hidden-repl-history-file' ) ;
91
- const devNullHistoryPath = path . join ( common . tmpDir ,
92
- '.dev-null-repl-history-file' ) ;
93
94
94
95
const tests = [
95
96
{
0 commit comments