Commit Graph

43 Commits

Author SHA1 Message Date
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
0beb3dbeea chore: use Deno.(read/write)TextFile() 2023-11-06 14:56:59 +11:00
Asher Gomez
239e85ad6a
BREAKING(testing, assert): move std/testing/asserts to std/assert (#3445) 2023-07-13 16:04:30 +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
Yasser A.Idrissi
eb69dbd380
feat(testing): add assertRejects, deprecate assertThrowsSync (#1101) 2021-08-09 14:59:52 +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
Anil Seervi
da10ca99c3 Fixed Typo (denoland/deno#5495) 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
Bartek Iwańczuk
4facff44f2 BREAKING: remove overload of Deno.test() (denoland/deno#4951)
This commit removes overload of Deno.test() that accepted named
function.
2021-02-01 10:46:57 +00:00
Nayeem Rahman
b10a0edb43 refactor(cli/js/ops/fs): Improve readdir() and FileInfo interfaces (denoland/deno#4763) 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
Kevin (Kun) "Kassimo" Qian
bce291ef41 http: allow response body to be string (denoland/deno#3705) 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
81c208e641 fix permission errors are swallowed by fs.emptyDir (denoland/deno#3501) 2021-02-01 10:46:56 +00:00
Kitson Kelly
1c5db631f7 Update to TypeScript 3.7 (denoland/deno#3275)
and update to prettier 1.19

Also, update `assert()` and remove not null assertions where possibly
in `cli`.

Closes denoland/deno#3273
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
Ryan Dahl
d491d2e747 Run deno_std tests in github actions 2021-02-01 10:46:56 +00:00
Axetroy
06958a4ada bump prettier to 1.18.2 (#592) 2019-09-11 23:31:23 -04:00
Vincent LE GOFF
67641b8ea5 fix emptydir on windows (#531) 2019-07-08 11:09:23 -04:00
Yoshiya Hinosawa
3ea90d54f6 Upgrade to v0.11.0 (update Reader interface) (#527) 2019-07-07 15:20:41 -04:00
Vincent LE GOFF
4543b563a9 Eslint fixes (#356)
Make warnings fail
2019-04-24 07:41:22 -04:00
Axetroy
59adafe867 fix: wrong usage of assertThrowsAsync which without await keyword (#295) 2019-03-19 13:22:33 -04:00
Axetroy
64d6bfca56 feat: add emptyDir for fs modules (#263) 2019-03-11 14:19:52 -04:00