summaryrefslogtreecommitdiff
path: root/cli/tests/unit_node/_fs
AgeCommit message (Collapse)Author
2024-02-10chore: move cli/tests/ -> tests/ (#22369)Matt Mastracci
This looks like a massive PR, but it's only a move from cli/tests -> tests, and updates of relative paths for files. This is the first step towards aggregate all of the integration test files under tests/, which will lead to a set of integration tests that can run without the CLI binary being built. While we could leave these tests under `cli`, it would require us to keep a more complex directory structure for the various test runners. In addition, we have a lot of complexity to ignore various test files in the `cli` project itself (cargo publish exclusion rules, autotests = false, etc). And finally, the `tests/` folder will eventually house the `test_ffi`, `test_napi` and other testing code, reducing the size of the root repo directory. For easier review, the extremely large and noisy "move" is in the first commit (with no changes -- just a move), while the remainder of the changes to actual files is in the second commit.
2024-02-07chore(cli): Use @test_util for relative path for unit tests (#22327)Matt Mastracci
This removes the majority of `../../../../../../test_util` relative imports from the codebase, allowing us to move this code more easily in the future.
2024-01-24feat: deprecate `Deno.fstat()` and `Deno.fstatSync()` (#22068)Asher Gomez
For removal in Deno v2.
2024-01-24feat: deprecate `Deno.write()` and `Deno.writeSync()` (#22064)Asher Gomez
For removal in Deno v2.
2024-01-24feat: deprecate `Deno.close()` (#22066)Asher Gomez
For removal in Deno v2. --------- Co-authored-by: Bartek Iwańczuk <biwanczuk@gmail.com>
2024-01-24feat: deprecate `Deno.ftruncate()` and `Deno.ftruncateSync()` (#22069)Asher Gomez
For removal in Deno 2.0.
2024-01-24feat: deprecate `Deno.resources()` (#22059)Asher Gomez
Most uses of `Deno.resources()` within tests, as they previously checked for leaked resources. This is not needed as the test runner does this automatically. Other internal uses of this API have been replaced with the internal `Deno[Deno.internal].core.resources()`.
2024-01-23fix(ext/node): fix no arg call of fs.promises.readFile (#22030)Yoshiya Hinosawa
2024-01-21chore: use `Deno.writeTextFile()` where appropriate (#22008)Asher Gomez
2024-01-01chore: update copyright to 2024 (#21753)David Sherret
2023-12-02chore: update std to 0.208.0 (#21318)Asher Gomez
Re-attempt at #21284. I was more thorough this time. --------- Signed-off-by: Asher Gomez <ashersaupingomez@gmail.com>
2023-11-22refactor: replace `deferred()` from `std/async` with ↵Asher Gomez
`Promise.withResolvers()` (#21234) Closes #21041 --------- Signed-off-by: Asher Gomez <ashersaupingomez@gmail.com>
2023-11-22Revert "chore: update to `std@0.207.0` (#21284)" (#21295)Bartek Iwańczuk
This reverts commit 20aa0796e6ff7651cdfce4d0292bdb11da5dfe2e. `main` has been failing consistenly on `kv_undelivered_test` and `serve_test` after this upgrade.
2023-11-22chore: update to `std@0.207.0` (#21284)Asher Gomez
Closes #21002
2023-10-28Revert "chore: update deno_std submodule (#20994)" (#21001)Bartek Iwańczuk
This reverts commit 6e2abb2b13af5dff5d631fb1bc0c279c49ebd066.
2023-10-27chore: update deno_std submodule (#20994)Bartek Iwańczuk
2023-10-22fix(polyfill): correctly handle flag when its equal 0 (#20953)sigmaSd
Fixes https://github.com/denoland/deno/issues/20910
2023-07-04fix: bump default @types/node version range to 18.16.19 (#19706)David Sherret
2023-07-04tests: deflake _fs_read_test.ts again (#19705)Bartek Iwańczuk
2023-07-03tests: deflake _fs_read_test.ts (#19699)Bartek Iwańczuk
Closes https://github.com/denoland/deno/issues/19632
2023-06-26test(ext/node): add fs read unit tests (#19588)Kaique da Silva
2023-06-22test(ext/node): add fs open unit test from std (#19505)Kaique da Silva
2023-06-19test(ext/node): port _fs_writeFile_test.ts from deno_std (#19524)Felipe Baltor
2023-06-13test(ext/node): add fs dirent unit test from std (#19461)Kaique da Silva
Co-authored-by: Yoshiya Hinosawa <stibium121@gmail.com>
2023-06-08feat(node_compat): Add a write method to the FileHandle class (#19385)nasa
## WHY ref: https://github.com/denoland/deno/issues/19165 The FileHandle class has many missing methods compared to node. ## WHAT Add write method
2023-06-08feat(node_compat): Add a read method to the FileHandle class (#19359)nasa
ref: #19165 The FileHandle class has many missing methods compared to node.
2023-06-05feat(node_compat): Add a close method to the FileHandle class. (#19357)nasa
## WHY ref: https://github.com/denoland/deno/issues/19165 The FileHandle class has many missing methods compared to node. Add these. ## WHAT - Add close method --------- Co-authored-by: Matt Mastracci <matthew@mastracci.com>
2023-06-02feat(node_compat): Added base implementation of FileHandle (#19294)nasa
<!-- Before submitting a PR, please read https://deno.com/manual/contributing 1. Give the PR a descriptive title. Examples of good title: - fix(std/http): Fix race condition in server - docs(console): Update docstrings - feat(doc): Handle nested reexports Examples of bad title: - fix #7123 - update docs - fix bugs 2. Ensure there is a related issue and it is referenced in the PR text. 3. Ensure there are tests that cover the changes. 4. Ensure `cargo test` passes. 5. Ensure `./tools/format.js` passes without changing files. 6. Ensure `./tools/lint.js` passes. 7. Open as a draft PR if your work is still in progress. The CI won't run all steps, but you can add '[ci]' to a commit message to force it to. 8. If you would like to run the benchmarks on the CI, add the 'ci-bench' label. --> ## WHY ref: https://github.com/denoland/deno/issues/19165 Node's fs/promises includes a FileHandle class, but deno does not. The open function in Node's fs/promises returns a FileHandle, which provides an IO interface to the file. However, deno's open function returns a resource id. ### deno ```js > const fs = await import("node:fs/promises"); undefined > const file3 = await fs.open("./README.md"); undefined > file3 3 > file3.read undefined Node: ``` ### Node ```js > const fs = await import("fs/promises"); undefined > const file3 = await fs.open("./tests/e2e_unit/testdata/file.txt"); undefined > file3 FileHandle { _events: [Object: null prototype] {}, _eventsCount: 0, _maxListeners: undefined, close: [Function: close], [Symbol(kCapture)]: false, [Symbol(kHandle)]: FileHandle {}, [Symbol(kFd)]: 24, [Symbol(kRefs)]: 1, [Symbol(kClosePromise)]: null } > file3.read [Function: read] ``` To be compatible with Node, deno's open function should also return a FileHandle. ## WHAT I have implemented the first step in adding a FileHandle. - Changed the return value of the open function to a FileHandle object - Implemented the readFile method in FileHandle - Add test code ## What to do next This PR is the first step in adding a FileHandle, and there are things that should be done next. - Add functionality equivalent to Node's FileHandle to FileHandle (currently there is only readFile) --------- Co-authored-by: Matt Mastracci <matthew@mastracci.com>
2023-03-28test(node/fs): add fs.Dir tests (#18463)Kamal Singh
Co-authored-by: Yoshiya Hinosawa <stibium121@gmail.com>
2023-03-20test(ext/node): port _fs tests from std/node (#18262)Max Dahlgren
Co-authored-by: Yoshiya Hinosawa <stibium121@gmail.com>
2023-03-19test(ext/node): add _fs_access_test.ts and _fs_watch_test.ts (#18249)Sanskar Gauchan
part of https://github.com/denoland/deno/issues/17840