Commit Graph

40 Commits

Author SHA1 Message Date
Ian Bull
a8a1d42aa7
refactor(fs): align additional error messages (#5802) 2024-08-26 13:31:34 +09:00
Yoshiya Hinosawa
3155f0050a
chore: switch to JSR-oriented codebase (#4650) 2024-04-29 11:57:30 +09:00
Anwesh
3fcb0a8b24
refactor(using): use using keyword for Explicit Resource Management (#4143)
* refactor(using): add using keyword for Explicit Resource Management

* refactor(using): fix fmt

* refactor(using): add more fixes

* refactor(using): fix fmt

* refactor: add more `using` cases

---------

Co-authored-by: Asher Gomez <ashersaupingomez@gmail.com>
2024-01-15 08:35:50 +11:00
Lino Le Van
c46143f0ac
chore: update copyright year (#4046)
* chore: update copyright year

* fix

---------

Co-authored-by: Asher Gomez <ashersaupingomez@gmail.com>
2024-01-02 08:11:32 +11:00
Vasu Singh
9a55a6e6e4
fix(fs): improve exists() test coverage (#3898)
* fix(test): improve exists test coverage

* fix(test): improve exists test coverage
2023-12-06 08:07:58 +11:00
Jacob Avery
bc540fbf07
refactor(fs): correct test names (#3835)
* chore(fs): Update fs test descriptions

* fixes "throws" to "rejects" when appropriate

* Update fs/eol_test.ts

---------

Co-authored-by: Asher Gomez <ashersaupingomez@gmail.com>
2023-11-23 17:59:59 +11:00
Asher Gomez
e3289ed93b
chore: parallel tests (#3446) 2023-07-23 17:47:21 +09:00
Asher Gomez
239e85ad6a
BREAKING(testing, assert): move std/testing/asserts to std/assert (#3445) 2023-07-13 16:04:30 +09:00
Martin Braun
a31339e18e
feat(fs): undo deprecation of exists and add permission and type check to it (#2785) 2023-03-30 14:57:40 +09:00
ayame113
b4239898d6
chore: update copyright header (#3082) 2023-01-03 19:47:44 +09:00
Asher Gomez
b72d3eb42a
refactor: replace Deno.spawn with Deno.Command (#2886) 2022-11-15 15:00:59 +09:00
Asher Gomez
3b9fb39ddd
chore: remove void and Promise<void> return types (#2550) 2022-08-24 10:21:57 +09:00
Leo Kettmeir
852968f631
refactor: switch the Deno.spawn (#2161) 2022-05-25 11:08:27 +02:00
Satya Rohith
3932b7e6e7
test: add --no-prompt to deno run (#1990) 2022-03-03 18:54:09 +05:30
Yoshiya Hinosawa
808fe203e0
chore: update copyright header (#1871) 2022-02-02 23:21:39 +09:00
William Perron
69f3d67cb2
chore: remove Promise<void> return type annotation (#819)
There's a couple of instances where `Promise<void>` is still there,
those are the exceptions, for example functions that explicitely return
a `Promise` object or functions that return the promise from another
function call without any `await` statement.

used this one-liner to automatically remove everything:

```bash
grep -rli 'promise<void>' | xargs sed -i 's/: Promise<void>//g
```
2021-04-05 07:49:05 -04:00
Yusuke Tanaka
d8a589ac80 chore: update copyright to 2021 (denoland/deno#9092) 2021-02-01 10:46:59 +00:00
Bartek Iwańczuk
4379f0a9c1 test: make test output less noisy (denoland/deno#8445)
This commit makes output of  tests less noisy
by passing "--quiet" flag to Deno subprocesses run
as part of test suite.
2021-02-01 10:46:58 +00:00
Tim Reichen
55a7adb58e rename(testing): rename assert*Contains to assert*Includes (denoland/deno#7951)
This commit renames two assertion functions to better align with JS API:
- assertStringContains -> assertStringIncludes
- assertArrayContains -> assertArrayIncludes
2021-02-01 10:46:58 +00:00
Casper Beyer
ff1382572e test(fs): make tests runnable from any directory (denoland/deno#7388) 2021-02-01 10:46:58 +00:00
Trivikram Kamat
6f30c8bd57 test: remove unstable from multiple tests (denoland/deno#6882) 2021-02-01 10:46:58 +00:00
David Sherret
1425960509 Use dprint for internal formatting (denoland/deno#6682) 2021-02-01 10:46:58 +00:00
Casper Beyer
eb9127bf38 Rename abbreviated assertions in testing (denoland/deno#6118) 2021-02-01 10:46:57 +00:00
Luca Casonato
94e6c3d329 Unstable methods should not appear in runtime or d.ts (denoland/deno#4957)
Co-authored-by: Kitson Kelly <me@kitsonkelly.com>
2021-02-01 10:46:57 +00:00
Kitson Kelly
7914eae5f0 Update to Prettier 2 and use ES Private Fields (denoland/deno#4498) 2021-02-01 10:46:57 +00:00
Akshat Agarwal
fc96083668 BREAKING CHANGE Rename Deno.run's args to cmd (denoland/deno#4444)
This is to avoid confusion with Deno.args which does not include the 
executable to be run.
2021-02-01 10:46:57 +00:00
Bartek Iwańczuk
a19e660a30 feat: Deno.test() sanitizes ops and resources (denoland/deno#4399)
This PR brings assertOps and assertResources sanitizers to Deno.test() API.

assertOps checks that test doesn't leak async ops, ie. there are no unresolved
promises originating from Deno APIs. Enabled by default, can be disabled using 
Deno.TestDefinition.disableOpSanitizer.

assertResources checks that test doesn't leak resources, ie. all resources used
in test are closed. For example; if a file is opened during a test case it must be
explicitly closed before test case finishes. It's most useful for asynchronous
generators. Enabled by default, can be disabled using 
Deno.TestDefinition.disableResourceSanitizer.

We've used those sanitizers in internal runtime tests and it proved very useful in
surfacing incorrect tests which resulted in interference between the tests.

All tests have been sanitized.

Closes denoland/deno#4208
2021-02-01 10:46:57 +00:00
Yusuke Sakurai
589ac5af6f reduce unnecessary output on tests (denoland/deno#4148) 2021-02-01 10:46:57 +00:00
Maximilien Mellen
623a601fd5 Enable TS strict mode by default (denoland/deno#3899)
Fixes denoland/deno#3324 

Co-authored-by: Kitson Kelly <me@kitsonkelly.com>
2021-02-01 10:46:57 +00:00
Bartek Iwańczuk
82a523639a refactor: rewrite tests in to use Deno.test (denoland/deno#3930) 2021-02-01 10:46:57 +00:00
Bartek Iwańczuk
6b46758ef7 dx: descriptive permission errors (denoland/deno#3808)
Before:
```
▶ target/debug/deno https://deno.land/examples/echo_server.ts
error: Uncaught PermissionDenied: run again with the --allow-net flag
► $deno$/dispatch_json.ts:40:11
    at DenoError ($deno$/errors.ts:20:5)
    at unwrapResponse ($deno$/dispatch_json.ts:40:11)
    at sendSync ($deno$/dispatch_json.ts:67:10)
    at listen ($deno$/net.ts:170:15)
    at https://deno.land/examples/echo_server.ts:4:23
```

```
▶ target/debug/deno --allow-read=/usr https://deno.land/examples/cat.ts /etc/passwd
error: Uncaught PermissionDenied: run again with the --allow-read flag
► $deno$/dispatch_json.ts:40:11
    at DenoError ($deno$/errors.ts:20:5)
    at unwrapResponse ($deno$/dispatch_json.ts:40:11)
    at sendAsync ($deno$/dispatch_json.ts:91:10)
```

After:
```
▶ target/debug/deno https://deno.land/examples/echo_server.ts
error: Uncaught PermissionDenied: network access to "0.0.0.0:8080", run again with the --allow-net flag
► $deno$/dispatch_json.ts:40:11
    at DenoError ($deno$/errors.ts:20:5)
    at unwrapResponse ($deno$/dispatch_json.ts:40:11)
    at sendSync ($deno$/dispatch_json.ts:67:10)
    at listen ($deno$/net.ts:170:15)
    at https://deno.land/examples/echo_server.ts:4:23
```

```
▶ target/debug/deno --allow-read=/usr https://deno.land/examples/cat.ts /etc/passwd
error: Uncaught PermissionDenied: read access to "/etc/passwd", run again with the --allow-read flag
► $deno$/dispatch_json.ts:40:11
    at DenoError ($deno$/errors.ts:20:5)
    at unwrapResponse ($deno$/dispatch_json.ts:40:11)
    at sendAsync ($deno$/dispatch_json.ts:91:10)
```
2021-02-01 10:46:56 +00:00
Ry Dahl
06059e0f22 Revert "feat(flags): script arguments come after '--'" (denoland/deno#3681)
Due to complaints about ergonomics and because it breaks shebang on
linux.

This reverts commit 2d5457df15d8c4a81362bb2d185b5c6013faa1d8.

BREAKING CHANGE
2021-02-01 10:46:56 +00:00
Ry Dahl
ccf4c766d0 feat(flags): script arguments come after '--' (denoland/deno#3621) 2021-02-01 10:46:56 +00:00
Ry Dahl
3a9eb92372 Happy new year! (denoland/deno#3578) 2021-02-01 10:46:56 +00:00
Axetroy
3bd58c2d3d fix permission errors are swallowed by fs.exists (denoland/deno#3493) 2021-02-01 10:46:56 +00:00
Nayeem Rahman
5b2aec7a62 std: Move fs/path to the top-level (denoland/deno#3100) 2021-02-01 10:46:56 +00:00
Axetroy
b04fda30c8 lint: add max line length rules (#507) 2019-06-18 21:22:01 -07:00
Vincent LE GOFF
4543b563a9 Eslint fixes (#356)
Make warnings fail
2019-04-24 07:41:22 -04:00
Axetroy
264a51c093 fix: fs.exists not work for symlink (#291) 2019-03-18 12:34:54 -04:00
Axetroy
142a1c6cf8 add fs/exists (#260) 2019-03-11 13:14:26 -04:00