summaryrefslogtreecommitdiff
path: root/test/parallel/test-fs-link.js
AgeCommit message (Collapse)Author
2019-03-10benchmark,doc,lib,test: capitalize commentsRuben Bridgewater
PR-URL: https://github.com/nodejs/node/pull/26483 Reviewed-By: Vse Mozhet Byt <vsemozhetbyt@gmail.com> Reviewed-By: Michaël Zasso <targos@protonmail.com>
2018-11-09test: fix the arguments order in `assert.strictEqual`mzucker
This change was initiated from the NodeConfEU session. PR-URL: https://github.com/nodejs/node/pull/24227 Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de> Reviewed-By: Colin Ihrig <cjihrig@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-12-22fs: move type checking to jsJames M Snell
PR-URL: https://github.com/nodejs/node/pull/17667 Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com> Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
2017-05-20fs: Revert throw on invalid callbacksMyles Borins
This reverts 4cb5f3daa350421e4eb4622dc818633d3a0659b3 Based on community feedback I think we should consider reverting this change. We should explore how this could be solved via linting rules. Refs: https://github.com/nodejs/node/pull/12562 PR-URL: https://github.com/nodejs/node/pull/12976 Reviewed-By: Sakthipriyan Vairamani <thechargingvolcano@gmail.com> Reviewed-By: Evan Lucas <evanlucas@me.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Rich Trott <rtrott@gmail.com>
2017-05-10fs: throw on invalid callbacks for async functionsSakthipriyan Vairamani (thefourtheye)
If an asynchronous function is passed no callback function, there is no way to return the result. This patch throws an error if the callback passed is not valid or none passed at all. PR-URL: https://github.com/nodejs/node/pull/12562 Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Anna Henningsen <anna@addaleax.net>
2017-05-01test,lib,doc: use function declarationsRich Trott
Replace function expressions with function declarations in preparation for a lint rule requiring function declarations. PR-URL: https://github.com/nodejs/node/pull/12711 Reviewed-By: Vse Mozhet Byt <vsemozhetbyt@gmail.com> Reviewed-By: Gibson Fahnestock <gibfahn@gmail.com>
2017-01-02test: increase usage of assert.ifError()cjihrig
PR-URL: https://github.com/nodejs/node/pull/10543 Reviewed-By: Gibson Fahnestock <gibfahn@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Rich Trott <rtrott@gmail.com> Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
2016-08-05Revert "fs: make callback mandatory to all async functions"Myles Borins
This reverts commit 9359de9dd2eae06ed5afcb75dad9bd4c466eb69d. Original Commit Message: The "fs" module has two functions called `maybeCallback` and `makeCallback`, as of now. The `maybeCallback` creates a default function to report errors, if the parameter passed is not a function object. Basically, if the callback is omitted in some cases, this function is used to create a default callback function. The `makeCallback`, OTOH, creates a default function only if the parameter passed is `undefined`, and if it is not a function object it will throw an `Error`. This patch removes the `maybeCallback` function and makes the callback function argument mandatory for all the async functions. PR-URL: https://github.com/nodejs/node/pull/7168 Reviewed-By: Trevor Norris <trev.norris@gmail.com> PR-URL: https://github.com/nodejs/node/pull/7846 Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: James M Snell <jasnell@gmail.com>
2016-07-22fs: make callback mandatory to all async functionsSakthipriyan Vairamani
The "fs" module has two functions called `maybeCallback` and `makeCallback`, as of now. The `maybeCallback` creates a default function to report errors, if the parameter passed is not a function object. Basically, if the callback is omitted in some cases, this function is used to create a default callback function. The `makeCallback`, OTOH, creates a default function only if the parameter passed is `undefined`, and if it is not a function object it will throw an `Error`. This patch removes the `maybeCallback` function and makes the callback function argument mandatory for all the async functions. PR-URL: https://github.com/nodejs/node/pull/7168 Reviewed-By: Trevor Norris <trev.norris@gmail.com>
2016-03-25fs: Buffer and encoding enhancements to fs APIJames M Snell
This makes several changes: 1. Allow path/filename to be passed in as a Buffer on fs methods 2. Add `options.encoding` to fs.readdir, fs.readdirSync, fs.readlink, fs.readlinkSync and fs.watch. 3. Documentation updates For 1... it's now possible to do: ```js fs.open(Buffer('/fs/foo/bar'), 'w+', (err, fd) => { }); ``` For 2... ```js fs.readdir('/fs/foo/bar', {encoding:'hex'}, (err,list) => { }); fs.readdir('/fs/foo/bar', {encoding:'buffer'}, (err, list) => { }); ``` encoding can also be passed as a string ```js fs.readdir('/fs/foo/bar', 'hex', (err,list) => { }); ``` The default encoding is set to UTF8 so this addresses the discrepency that existed previously between fs.readdir and fs.watch handling filenames differently. Fixes: https://github.com/nodejs/node/issues/2088 Refs: https://github.com/nodejs/node/issues/3519 PR-URL: https://github.com/nodejs/node/pull/5616 Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl> Reviewed-By: Trevor Norris <trev.norris@gmail.com>
2016-01-26test: fs.link() test runs on same deviceDrew Folta
When running the tests if `NODE_TEST_DIR` is set to a device different than the location of the test files (where this repo is checked out), then the parallel/test-fs-link.js test will fail with `EXDEV: cross-device link not permitted`. The code works fine (and is in fact throwing an error as desired) but the test fails. This commit first creates the "source" file in the same directory as the "destination" (where the hardlink will be created). PR-URL: https://github.com/nodejs/node/pull/4861 Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl> Reviewed-By: Rich Trott <rtrott@gmail.com>
2015-11-20fs: fix the error report on fs.link(Sync)yorkie
As the Node.js documentation specified: > fs.link(srcpath, dstpath, callback) But when we run: ```js > fs.link() ``` We will get the below: ```js TypeError: dest path must be a string at TypeError (native) at Object.fs.link (fs.js:915:11) at repl:1:4 ``` Just correct the message of relevant 2 errors in this PR :-) PR-URL: https://github.com/nodejs/node/pull/3917 Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com>
2015-10-20test: fix flaky test for symlinksRich Trott
If the symlink portion of the test was being skipped due to a combination of OS support and user privileges, then an assertion would always fail. This fixes that problem, improves assertion error reporting and splits the test to make it clear that it is a test for links and symlinks. Fixes: https://github.com/nodejs/node/issues/3311 PR-URL: https://github.com/nodejs/node/pull/3418 Reviewed-By: Johan Bergström <bugs@bergstroem.nu>