aboutsummaryrefslogtreecommitdiff
path: root/test/parallel/test-fs-error-messages.js
AgeCommit message (Collapse)Author
2019-03-27benchmark,doc,lib: capitalize more commentsRuben Bridgewater
PR-URL: https://github.com/nodejs/node/pull/26849 Reviewed-By: Rich Trott <rtrott@gmail.com> Reviewed-By: Vse Mozhet Byt <vsemozhetbyt@gmail.com>
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-28test: validate fs.rename() when NODE_TEST_DIR on separate mountDrew Folta
When testing fs.rename() of an non-existent file, use a destination path which is in the same directory. Otherwise we might trigger an `EXDEV` error if NODE_TEST_DIR is a separate device than the current working directory. Fixes: https://github.com/nodejs/node/issues/21669 PR-URL: https://github.com/nodejs/node/pull/24707 Reviewed-By: Rich Trott <rtrott@gmail.com> Reviewed-By: Richard Lau <riclau@uk.ibm.com> Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
2018-11-10test: replacing fixture directory with tempsaurabhSiddhu
PR-URL: https://github.com/nodejs/node/pull/24077 Reviewed-By: Rich Trott <rtrott@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com>
2018-10-12test: refactor common.ddCommand()Rich Trott
* Remove different paths for Windows and POSIX. * Remove fixtures file. Simply run the command immediately/directly. * Since it is never called with more than one value for kilobytes, eliminate that argument. * Update/simplify tests that use this function. (They no longer need to use child_process to run the command.) * Update documentation. PR-URL: https://github.com/nodejs/node/pull/23411 Reviewed-By: Refael Ackermann <refack@gmail.com> Reviewed-By: Richard Lau <riclau@uk.ibm.com> Reviewed-By: Luigi Pinca <luigipinca@gmail.com> Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com> Reviewed-By: Sakthipriyan Vairamani <thechargingvolcano@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: George Adams <george.adams@uk.ibm.com>
2018-08-09src: move process.binding('uv') to internalBindingJames M Snell
PR-URL: https://github.com/nodejs/node/pull/22163 Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de> Reviewed-By: Gus Caplan <me@gus.host> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Tiancheng "Timothy" Gu <timothygu99@gmail.com> Reviewed-By: Trivikram Kamat <trivikr.dev@gmail.com> Reviewed-By: Jon Moss <me@jonathanmoss.me>
2018-07-17test: add support for NODE_TEST_DIR on a separate mount pointAntoine du HAMEL
Linux permits a filesystem to be mounted at multiple points, but `fs.renameSync` does not work across different mount points, even if the same filesystem is mounted on both. This fixes failing tests when NODE_TEST_DIR mount point is different from the one on which the tests are executed (E.G. on a separate partition). Ref: http://man7.org/linux/man-pages/man2/rename.2.html PR-URL: https://github.com/nodejs/node/pull/21552 Refs: http://man7.org/linux/man-pages/man2/rename.2.html Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com> Reviewed-By: Richard Lau <riclau@uk.ibm.com> Reviewed-By: Ben Coe <bencoe@gmail.com>
2018-06-01test: avoid empty fixture in fs testRich Trott
Refactor test-fs-error-messages to use tmpdir for its empty directory rather than using a not-actually-empty directory called "empty" in fixtures. PR-URL: https://github.com/nodejs/node/pull/21044 Reviewed-By: Anatoli Papirovski <apapirovski@mac.com> Reviewed-By: Trivikram Kamat <trivikr.dev@gmail.com> Reviewed-By: Richard Lau <riclau@uk.ibm.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
2018-04-29test: fix a TODO and remove obsolete TODOsRuben Bridgewater
This removes outdated TODOs and adds a test for invalid input in `fs.copyFile` and solves a TODO by doing so. PR-URL: https://github.com/nodejs/node/pull/20319 Reviewed-By: Daniel Bevenius <daniel.bevenius@gmail.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Trivikram Kamat <trivikr.dev@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com>
2018-03-02fs: throw futimesSync errors in JSJoyee Cheung
PR-URL: https://github.com/nodejs/node/pull/19041 Reviewed-By: Michaël Zasso <targos@protonmail.com> Reviewed-By: James M Snell <jasnell@gmail.com>
2018-03-02fs: throw writeSync errors in JSJoyee Cheung
PR-URL: https://github.com/nodejs/node/pull/19041 Reviewed-By: Michaël Zasso <targos@protonmail.com> Reviewed-By: James M Snell <jasnell@gmail.com>
2018-03-02fs: throw fchownSync errors in JSJoyee Cheung
PR-URL: https://github.com/nodejs/node/pull/19041 Reviewed-By: Michaël Zasso <targos@protonmail.com> Reviewed-By: James M Snell <jasnell@gmail.com>
2018-03-02fs: throw fchmodSync errors in JSJoyee Cheung
PR-URL: https://github.com/nodejs/node/pull/19041 Reviewed-By: Michaël Zasso <targos@protonmail.com> Reviewed-By: James M Snell <jasnell@gmail.com>
2018-03-02fs: throw readSync errors in JSJoyee Cheung
PR-URL: https://github.com/nodejs/node/pull/19041 Reviewed-By: Michaël Zasso <targos@protonmail.com> Reviewed-By: James M Snell <jasnell@gmail.com>
2018-02-27fs: throw copyFileSync errors in JSJoyee Cheung
PR-URL: https://github.com/nodejs/node/pull/18871 Refs: https://github.com/nodejs/node/issues/18106 Reviewed-By: Michaël Zasso <targos@protonmail.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
2018-02-27fs: throw fs.mkdtempSync errors in JS landJoyee Cheung
PR-URL: https://github.com/nodejs/node/pull/18871 Refs: https://github.com/nodejs/node/issues/18106 Reviewed-By: Michaël Zasso <targos@protonmail.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
2018-02-27fs: throw fs.utimesSync errors in JS landJoyee Cheung
PR-URL: https://github.com/nodejs/node/pull/18871 Refs: https://github.com/nodejs/node/issues/18106 Reviewed-By: Michaël Zasso <targos@protonmail.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
2018-02-27fs: throw fs.chownSync errors in JS landJoyee Cheung
PR-URL: https://github.com/nodejs/node/pull/18871 Refs: https://github.com/nodejs/node/issues/18106 Reviewed-By: Michaël Zasso <targos@protonmail.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
2018-02-27fs: throw realpathSync.native errors in JSJoyee Cheung
PR-URL: https://github.com/nodejs/node/pull/18871 Refs: https://github.com/nodejs/node/issues/18106 Reviewed-By: Michaël Zasso <targos@protonmail.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
2018-02-22test: use runWithInvalidFD() in tests expecting EBADFJoyee Cheung
PR-URL: https://github.com/nodejs/node/pull/18864 Fixes: https://github.com/nodejs/node/issues/18820 Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
2018-02-01fs: throw errors from fs.fsyncSync in JSJoyee Cheung
PR-URL: https://github.com/nodejs/node/pull/18348 Refs: https://github.com/nodejs/node/issues/18106 Reviewed-By: Michaël Zasso <targos@protonmail.com> Reviewed-By: James M Snell <jasnell@gmail.com>
2018-02-01fs: throw errors from fs.fdatasyncSync in JSJoyee Cheung
PR-URL: https://github.com/nodejs/node/pull/18348 Refs: https://github.com/nodejs/node/issues/18106 Reviewed-By: Michaël Zasso <targos@protonmail.com> Reviewed-By: James M Snell <jasnell@gmail.com>
2018-02-01fs: throw errors from fs.ftruncateSync in JSJoyee Cheung
PR-URL: https://github.com/nodejs/node/pull/18348 Refs: https://github.com/nodejs/node/issues/18106 Reviewed-By: Michaël Zasso <targos@protonmail.com> Reviewed-By: James M Snell <jasnell@gmail.com>
2018-01-24test: improve fs error message testJoyee Cheung
- Reuse error validators for sync and async tests - Validate properties of the errors PR-URL: https://github.com/nodejs/node/pull/18277 Reviewed-By: Michaël Zasso <targos@protonmail.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com>
2018-01-17test: test error messages from fs.realpath{Sync}Joyee Cheung
PR-URL: https://github.com/nodejs/node/pull/17914 Reviewed-By: Matteo Collina <matteo.collina@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com>
2018-01-17test: verify errors thrown from fs stat APIsJoyee Cheung
PR-URL: https://github.com/nodejs/node/pull/17914 Reviewed-By: Matteo Collina <matteo.collina@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com>
2017-10-19test: use fixtures moduleKanika Shah
PR-URL: https://github.com/nodejs/node/pull/15959 Reviewed-By: Daijiro Wachi <daijiro.wachi@gmail.com> Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de> Reviewed-By: Tobias Nießen <tniessen@tnie.de> Reviewed-By: Gireesh Punathil <gpunathi@in.ibm.com> Reviewed-By: Rich Trott <rtrott@gmail.com> Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
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-04-30test: replace indexOf with includesgwer
Start the transition to Array.prototype.includes() and String.prototype.includes(). This commit refactors most of the comparisons of Array.prototype.indexOf() and String.prototype.indexOf() return values with -1 to the former methods in tests. PR-URL: https://github.com/nodejs/node/pull/12604 Refs: https://github.com/nodejs/node/issues/12586 Reviewed-By: Alexey Orlenko <eaglexrlnk@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Gibson Fahnestock <gibfahn@gmail.com>
2017-03-10meta: restore original copyright headerJames M Snell
A prior io.js era commit inappropriately removed the original copyright statements from the source. This restores those in any files still remaining from that edit. Ref: https://github.com/nodejs/TSC/issues/174 Ref: https://github.com/nodejs/node/pull/10599 PR-URL: https://github.com/nodejs/node/pull/10155 Note: This PR was required, reviewed-by and approved by the Node.js Foundation Legal Committee and the TSC. There is no `Approved-By:` meta data.
2017-02-03Revert "test: refactor test-fs-error-messages.js"James M Snell
This reverts commit 907ce8dd6c297661a21a8ef5b638b76352523aa2. PR-URL: https://github.com/nodejs/node/pull/11155 Reviewed-By: Michael Dawson <michael_dawson@ca.ibm.com> Reviewed-By: Timothy Gu <timothygu99@gmail.com>
2017-02-03test: refactor test-fs-error-messages.jsAdrian Estrada
* group tests by error type * improve error validation for all messages * use assert.throws instead of try and catch * use arrow functions * add missing test for readdir * add missing test for readFileSync * remove unnecessary variables PR-URL: https://github.com/nodejs/node/pull/11096 Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Italo A. Casas <me@italoacasas.com>
2017-01-11test: s/assert.equal/assert.strictEqual/Gibson Fahnestock
Use assert.strictEqual instead of assert.equal in tests, manually convert types where necessary. PR-URL: https://github.com/nodejs/node/pull/10698 Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Michael Dawson <michael_dawson@ca.ibm.com> Reviewed-By: Sakthipriyan Vairamani <thechargingvolcano@gmail.com> Reviewed-By: Michaël Zasso <targos@protonmail.com> Reviewed-By: Teddy Katz <teddy.katz@gmail.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-05-19test: enable linting for testsRoman Reiss
Enable linting for the test directory. A number of changes was made so all tests conform the current rules used by lib and src directories. The only exception for tests is that unreachable (dead) code is allowed. test-fs-non-number-arguments-throw had to be excluded from the changes because of a weird issue on Windows CI. PR-URL: https://github.com/nodejs/io.js/pull/1721 Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
2015-01-31fs: improve error messagesBert Belder
* Include a description for the error message * For rename, link, and symlink, include both the source and destination path in the error message. * Expose the destination path as the `dest` property on the error object. * Fix a bug where `ThrowUVException()` would incorrectly delegate to `Environment::TrowErrnoException()`. API impact: * Adds an extra overload for node::UVException() which takes 6 arguments. PR: https://github.com/iojs/io.js/pull/675 Fixes: https://github.com/iojs/io.js/issues/207 Closes: https://github.com/iojs/io.js/pull/293 Reviewed-by: Ben Noordhuis <info@bnoordhuis.nl>
2015-01-12Remove excessive copyright/license boilerplateisaacs
The copyright and license notice is already in the LICENSE file. There is no justifiable reason to also require that it be included in every file, since the individual files are not individually distributed except as part of the entire package.
2014-12-17test: split test in parallel/sequentialFedor Indutny
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl> PR-URL: https://github.com/iojs/io.js/pull/172 Fix: iojs/io.js#139