diff options
| author | Bartek IwaĆczuk <biwanczuk@gmail.com> | 2019-09-10 06:59:40 +0200 |
|---|---|---|
| committer | Ryan Dahl <ry@tinyclouds.org> | 2019-09-10 00:59:40 -0400 |
| commit | 2a83327a21e83180a21afd428b11aa03e3080346 (patch) | |
| tree | 670ac1ca0644d3b082d1baffc8514ad9d9fe3ef4 /tests | |
| parent | 377966764636350c524b526da50c055243ab3005 (diff) | |
fix: replace bad rid panics with errors (#2870)
Diffstat (limited to 'tests')
| -rw-r--r-- | tests/044_bad_resource.test | 4 | ||||
| -rw-r--r-- | tests/044_bad_resource.ts | 7 | ||||
| -rw-r--r-- | tests/044_bad_resource.ts.out | 6 |
3 files changed, 17 insertions, 0 deletions
diff --git a/tests/044_bad_resource.test b/tests/044_bad_resource.test new file mode 100644 index 000000000..8804fde1b --- /dev/null +++ b/tests/044_bad_resource.test @@ -0,0 +1,4 @@ +args: run --reload --allow-read tests/044_bad_resource.ts +output: tests/044_bad_resource.ts.out +check_stderr: true +exit_code: 1 diff --git a/tests/044_bad_resource.ts b/tests/044_bad_resource.ts new file mode 100644 index 000000000..d2fc828f0 --- /dev/null +++ b/tests/044_bad_resource.ts @@ -0,0 +1,7 @@ +async function main(): Promise<void> { + const file = await Deno.open("Cargo.toml", "r"); + file.close(); + await file.seek(10, 0); +} + +main(); diff --git a/tests/044_bad_resource.ts.out b/tests/044_bad_resource.ts.out new file mode 100644 index 000000000..155e4396f --- /dev/null +++ b/tests/044_bad_resource.ts.out @@ -0,0 +1,6 @@ +[WILDCARD] +error: Uncaught BadResource: bad resource id +[WILDCARD]dispatch_json.ts:[WILDCARD] + at DenoError ([WILDCARD]errors.ts:[WILDCARD]) + at unwrapResponse ([WILDCARD]dispatch_json.ts:[WILDCARD]) + at sendAsync ([WILDCARD]dispatch_json.ts:[WILDCARD]) |
