summaryrefslogtreecommitdiff
path: root/test/parallel/test-fs-fsync.js
Commit message (Collapse)AuthorAgeFilesLines
* test: add common.mustSucceedTobias Nießen2020-10-171-7/+3
| | | | | | PR-URL: https://github.com/nodejs/node/pull/35086 Reviewed-By: Ruy Adorno <ruyadorno@github.com> Reviewed-By: Rich Trott <rtrott@gmail.com>
* errors: improve ERR_INVALID_ARG_TYPERuben Bridgewater2019-12-201-3/+1
| | | | | | | | | | | | | | ERR_INVALID_ARG_TYPE is the most common error used throughout the code base. This improves the error message by providing more details to the user and by indicating more precisely which values are allowed ones and which ones are not. It adds the actual input to the error message in case it's a primitive. If it's a class instance, it'll print the class name instead of "object" and "falsy" or similar entries are not named "type" anymore. PR-URL: https://github.com/nodejs/node/pull/29675 Reviewed-By: Rich Trott <rtrott@gmail.com>
* test: clean tmpdir on process exitJoão Reis2019-08-101-0/+1
| | | | | | PR-URL: https://github.com/nodejs/node/pull/28858 Reviewed-By: Rich Trott <rtrott@gmail.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
* errors: update error nameRuben Bridgewater2019-03-231-1/+1
| | | | | | | | | | | | | | | This updates all Node.js errors by removing the `code` being part of the `name` property. Instead, the name is just changed once on instantiation, the stack is accessed to create the stack as expected and then the `name` property is set back to it's original form. PR-URL: https://github.com/nodejs/node/pull/26738 Fixes: https://github.com/nodejs/node/issues/26669 Fixes: https://github.com/nodejs/node/issues/20253 Reviewed-By: Gus Caplan <me@gus.host> Reviewed-By: Matteo Collina <matteo.collina@gmail.com> Reviewed-By: Michaël Zasso <targos@protonmail.com> Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com>
* fs: fix error handlingRuben Bridgewater2018-03-251-33/+11
| | | | | | | | | | | Right now there are multiple cases where the validated entry would not be returned or a wrong error is thrown. This fixes both cases. PR-URL: https://github.com/nodejs/node/pull/19445 Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Matteo Collina <matteo.collina@gmail.com> Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com> Reviewed-By: Anna Henningsen <anna@addaleax.net>
* test: move tmpdir to submodule of commonRich Trott2018-01-311-2/+3
| | | | | | | | | | 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>
* fs: move type checking to jsJames M Snell2017-12-221-23/+4
| | | | | | PR-URL: https://github.com/nodejs/node/pull/17667 Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com> Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
* test: do not open fixture files for writingRich Trott2017-12-221-1/+1
| | | | | | | | | | | | | | test-fs-fsync makes a copy of a fixture file, but then doesn't do anything with it and instead operates on the original fixture file. This appears to be in error, and this change fixes that. PR-URL: https://github.com/nodejs/node/pull/17808 Reviewed-By: Jon Moss <me@jonathanmoss.me> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Richard Lau <riclau@uk.ibm.com> Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de> Reviewed-By: Gireesh Punathil <gpunathi@in.ibm.com> Reviewed-By: James M Snell <jasnell@gmail.com>
* fs: move type checking for fs.sync to jsJames M Snell2017-12-131-2/+18
| | | | | | | | | | PR-URL: https://github.com/nodejs/node/pull/17334 Reviewed-By: Refael Ackermann <refack@gmail.com> Reviewed-By: Timothy Gu <timothygu99@gmail.com> Reviewed-By: Jon Moss <me@jonathanmoss.me> Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com> Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
* fs: move type checking for fs.fdatasync to jsJames M Snell2017-12-131-0/+38
| | | | | | | | | | PR-URL: https://github.com/nodejs/node/pull/17334 Reviewed-By: Refael Ackermann <refack@gmail.com> Reviewed-By: Timothy Gu <timothygu99@gmail.com> Reviewed-By: Jon Moss <me@jonathanmoss.me> Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com> Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
* test: update test-fs-fsync to run from tempatvoicu2017-09-241-2/+8
| | | | | | | | | | | | We copy the "a.js" file fixture to a temp directory and then we open it with write access. This makes sure we are only writing to the provided temp-dir and not in the fixture dir. PR-URL: https://github.com/nodejs/node/pull/15537 Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Luigi Pinca <luigipinca@gmail.com> Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
* test: begin normalizing fixtures useJames M Snell2017-08-071-2/+2
| | | | | | | | | | | | | | | | | | | | | Adds a new `../common/fixtures' module to begin normalizing `test/fixtures` use. Our test code is a bit inconsistent with regards to use of the fixtures directory. Some code uses `path.join()`, some code uses string concats, some other code uses template strings, etc. In mnay cases, significant duplication of code is seen when accessing fixture files, etc. This updates many (but by no means all) of the tests in the test suite to use the new consistent API. There are still many more to update, which would make an excelent Code-n-Learn exercise. PR-URL: https://github.com/nodejs/node/pull/14332 Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Gibson Fahnestock <gibfahn@gmail.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Tobias Nießen <tniessen@tnie.de> Reviewed-By: Michaël Zasso <targos@protonmail.com>
* meta: restore original copyright headerJames M Snell2017-03-101-0/+21
| | | | | | | | | | | | | | | 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.
* test: refactor test-fs-fsyncRob Adelmann2016-12-131-23/+14
| | | | | | | | | | | | | - replace var with const. - remove successes var. - use assert.ifError() for handling all errors. - wrap all callbacks with common.mustCall(). PR-URL: https://github.com/nodejs/node/pull/10176 Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Santiago Gimeno <santiago.gimeno@gmail.com> Reviewed-By: Italo A. Casas <me@italoacasas.com> Reviewed-By: Sakthipriyan Vairamani <thechargingvolcano@gmail.com>
* test: remove deprecated error loggingRich Trott2015-10-071-7/+0
| | | | | | | | | common.error() is just deprecated util.error() renamed. Remove calls to it and some other extraneous console logging in tests. PR-URL: https://github.com/nodejs/node/pull/3079 Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
* test: enable linting for testsRoman Reiss2015-05-191-1/+2
| | | | | | | | | | | | 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>
* Remove excessive copyright/license boilerplateisaacs2015-01-121-21/+0
| | | | | | | 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.
* test: split test in parallel/sequentialFedor Indutny2014-12-171-0/+59
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl> PR-URL: https://github.com/iojs/io.js/pull/172 Fix: iojs/io.js#139