summaryrefslogtreecommitdiff
path: root/test/parallel/test-repl-persistent-history.js
AgeCommit message (Collapse)Author
2018-12-05Revert "lib: repl multiline history support"Ruben Bridgewater
This reverts commit dd7a3d246ded89cd0c910231c9adec279e72f9a9. PR-URL: https://github.com/nodejs/node/pull/24804 Refs: https://github.com/nodejs/node/issues/24231 Reviewed-By: Anto Aravinth <anto.aravinth.cse@gmail.com> Reviewed-By: Michaël Zasso <targos@protonmail.com> Reviewed-By: Jeremiah Senkpiel <fishrock123@rocketmail.com>
2018-11-02lib: repl multiline history supportAnto Aravinth
PR-URL: https://github.com/nodejs/node/pull/22153 Reviewed-By: John-David Dalton <john.david.dalton@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com>
2018-05-19test: remove common.globalCheckRuben Bridgewater
This flag is partially used in tests where it was not necessary and it is always possible to replace this flag with `common.allowGlobals`. This makes sure all globals are truly tested for. PR-URL: https://github.com/nodejs/node/pull/20717 Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
2018-02-12repl: remove deprecated NODE_REPL_HISTORY_FILERuben Bridgewater
PR-URL: https://github.com/nodejs/node/pull/13876 Reviewed-By: Matteo Collina <matteo.collina@gmail.com> Reviewed-By: Michaël Zasso <targos@protonmail.com> Reviewed-By: Gibson Fahnestock <gibfahn@gmail.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
2018-02-08fs: throw errors on invalid paths synchronouslyJoyee Cheung
- Throw getPathFromURL() and nullCheck() errors synchronously instead of deferring them to the next tick, since we already throw validatePath() errors synchronously. - Merge nullCheck() into validatePath() - Never throws in `fs.exists()`, instead, invoke the callback with false, or emit a warning when the callback is not a function. This is to bring it inline with fs.existsSync(), which never throws. - Updates the comment of rethrow() - Throw ERR_INVALID_ARG_VALUE for null checks PR-URL: https://github.com/nodejs/node/pull/18308 Reviewed-By: Gireesh Punathil <gpunathi@in.ibm.com> Reviewed-By: Matteo Collina <matteo.collina@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com>
2018-01-31test: move tmpdir to submodule of commonRich Trott
Move tmpdir functionality to its own module (common/tmpdir). PR-URL: https://github.com/nodejs/node/pull/17856 Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Gibson Fahnestock <gibfahn@gmail.com> Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de> Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com>
2017-10-15test: fixtures in repl persistent history testJenna Zeigen
PR-URL: https://github.com/nodejs/node/pull/15999 Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Lance Ball <lball@redhat.com>
2017-10-08test: use defaultHistoryPath instead of path.joinChris Budy
PR-URL: https://github.com/nodejs/node/pull/15969 Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
2017-07-16test: use template literal for string concattobewhatwewant
In test/parallel/test-repl-persistent-history.js, replace string concatenation with a template literal. PR-URL: https://github.com/nodejs/node/pull/14288 Reviewed-By: Michaël Zasso <targos@protonmail.com> Reviewed-By: Rich Trott <rtrott@gmail.com> Reviewed-By: Gibson Fahnestock <gibfahn@gmail.com> Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Tobias Nießen <tniessen@tnie.de> Reviewed-By: Refael Ackermann <refack@gmail.com>
2017-06-30repl: fix old history error handlingRuben Bridgewater
PR-URL: https://github.com/nodejs/node/pull/13733 Reviewed-By: Luigi Pinca <luigipinca@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Tobias Nießen <tniessen@tnie.de>
2017-05-07test: refactored test-repl-persistent-historycool88
PR-URL: https://github.com/nodejs/node/pull/12703 Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Rich Trott <rtrott@gmail.com> Reviewed-By: Anna Henningsen <anna@addaleax.net>
2017-05-05test: reduce string concatenationsVse Mozhet Byt
PR-URL: https://github.com/nodejs/node/pull/12735 Refs: https://github.com/nodejs/node/pull/12455 Reviewed-By: Refael Ackermann <refack@gmail.com> Reviewed-By: Gibson Fahnestock <gibfahn@gmail.com>
2017-05-02repl: fix /dev/null history file regressionBrian White
This fixes a regression from 83887f35fa where ftruncate() fails on a file symlinked to /dev/null. PR-URL: https://github.com/nodejs/node/pull/12762 Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Jeremiah Senkpiel <fishrock123@rocketmail.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Bartosz Sosnowski <bartosz@janeasystems.com> Reviewed-By: James M Snell <jasnell@gmail.com>
2017-04-20repl: support hidden history file on WindowsBartosz Sosnowski
On Windows when REPL history file has the hidden attribute node will fail when trying to open it in 'w' mode. This changes the mode to 'r+'. The file is guaranteed to exists because of earlier open call with 'a+'. Fixes: https://github.com/nodejs/node/issues/5261 PR-URL: https://github.com/nodejs/node/pull/12207 Reviewed-By: James M Snell <jasnell@gmail.com>
2017-01-11test: use eslint to fix var->const/letGibson Fahnestock
Manually fix issues that eslint --fix couldn't do automatically. PR-URL: https://github.com/nodejs/node/pull/10685 Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Roman Reiss <me@silverwind.io>
2017-01-02test: avoid assigning this to variablescjihrig
This commit removes assignments of this to a variable in the tests. PR-URL: https://github.com/nodejs/node/pull/10548 Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Rich Trott <rtrott@gmail.com> Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
2016-10-19test,lib,benchmark: match function namesRich Trott
In most cases, named functions match the variable or property to which they are being assigned. That also seems to be the practice in a series of PRs currently being evaluated that name currently-anonymous functions. This change applies that rule to instances in the code base that don't comply with that practice. This will be enforceable with a lint rule once we upgrade to ESLint 3.8.0. PR-URL: https://github.com/nodejs/node/pull/9113 Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Franziska Hinkelmann <franziska.hinkelmann@gmail.com>
2016-09-27test: fixed FIXME in test-repl-persistent-historyAlfred Cepeda
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>
2016-08-19Revert "repl,util: insert carriage returns in output"Evan Lucas
This reverts commit fce4b981eacbce0b85a2418d042f1f67d40e9834. This was a breaking change and should have been marked semver-major. The change that was made altered the output of util.format() and util.inspect(). With how much those are used in the wild, this type of change deserves more justification. Fixes: https://github.com/nodejs/node/issues/8138 PR-URL: https://github.com/nodejs/node/pull/8143 Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: James M Snell <jasnell@gmail.com>
2016-08-13repl,util: insert carriage returns in outputJungMinu
`\n` is not enough for Linux with some custom stream add carriage returns to ensure that the output is displayed correctly using `\r\n` should not be a problem, even on non-Windows platforms. Fixes: https://github.com/nodejs/node/issues/7954 PR-URL: https://github.com/nodejs/node/pull/8028 Reviewed-By: Brian White <mscdex@mscdex.net> Reviewed-By: Anna Henningsen <anna@addaleax.net>
2016-08-08repl: don't override all internal repl defaultscjihrig
The createInternalRepl() module accepts an options object as an argument. However, if one is provided, it overrides all of the default options. This commit applies the options object to the defaults, only changing the values that are explicitly set. PR-URL: https://github.com/nodejs/node/pull/7826 Reviewed-By: James M Snell <jasnell@gmail.com>
2016-06-06test: use common.fixturesDir almost everywhereBryan English
Updating tests to use `common.fixturesDir` whenever possible/reasonable. Left out things like tests for `path` and `require.resolve`. PR-URL: https://github.com/nodejs/node/pull/6997 Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
2016-02-02test: fix variable redeclarationsRich Trott
I'm a fan of small changesets, but even I'm getting a little annoyed at me for opening all these PRs weeding out variable redeclarations. So I'm bundling a bunch of small changes here. PR-URL: https://github.com/nodejs/node/pull/4992 Reviewed-By: Michaël Zasso <mic.besace@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com>
2016-01-16repl: make sure historyPath is trimmedEvan Lucas
If one were to set NODE_REPL_HISTORY to a string that contains only a space (" "), then the history file would be created with that name which can cause problems are certain systems. PR-URL: https://github.com/nodejs/node/pull/4539 Reviewed-By: Sakthipriyan Vairamani <thechargingvolcano@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Jeremiah Senkpiel <fishrock123@rocketmail.com>
2016-01-13test: fix style issues after eslint updateMichaël Zasso
Replace var keyword with const or let. PR-URL: https://github.com/nodejs/io.js/pull/2286 Reviewed-By: Roman Reiss <me@silverwind.io>
2015-12-25test: remove unused `util` importsRich Trott
A number of tests in `test/parallel` were importing the `util` module via `require()` but not using `util` for anything. This removes those `require()` statements. PR-URL: https://github.com/nodejs/node/pull/4397 Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Rod Vagg <rod@vagg.org>
2015-12-22repl: Fixed node repl history edge case.Mudit Ameta
If the deprecated NODE_REPL_HISTORY_FILE is set to default node history file path ($HOME/.node_repl_history) and the file doesn't exist, then node creates the file and then crashes when it tries to parse that file as JSON thinking that it's an older JSON formatted history file. This fixes that bug. This patch also prevents node repl from throwing if the old history file is empty or if $HOME/.node_repl_history is empty. Fixes: https://github.com/nodejs/node/issues/4102 PR-URL: https://github.com/nodejs/node/pull/4108 Reviewed-By: Jeremiah Senkpiel <fishrock123@rocketmail.com>
2015-12-14test: parallelize test-repl-persistent-historyJeremiah Senkpiel
Refs: https://github.com/nodejs/node/pull/2224#issuecomment-127356413 PR-URL: https://github.com/nodejs/node/pull/4247 Reviewed-By: Rich Trott <rtrott@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com>