diff options
author | Kurt Mackey <mrkurt@gmail.com> | 2020-08-20 11:47:58 -0400 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-08-20 11:47:58 -0400 |
commit | cd67f7bdc8fbf1caef758113bab97cc6396321dc (patch) | |
tree | 1ddd5d415bfb3bb8bc667269c22d13386f79e2de /cli/tests | |
parent | 0095611af98d3039e30ff44444ab83f65bcec554 (diff) |
fix: Create body stream from any valid bodySource (#7128)
Fixes #6752
Diffstat (limited to 'cli/tests')
-rw-r--r-- | cli/tests/unit/body_test.ts | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/cli/tests/unit/body_test.ts b/cli/tests/unit/body_test.ts index b7393ad0d..d9979e703 100644 --- a/cli/tests/unit/body_test.ts +++ b/cli/tests/unit/body_test.ts @@ -1,5 +1,9 @@ // Copyright 2018-2020 the Deno authors. All rights reserved. MIT license. -import { unitTest, assertEquals, assert } from "./test_util.ts"; +import { + unitTest, + assertEquals, + assert, +} from "./test_util.ts"; // just a hack to get a body object // eslint-disable-next-line @typescript-eslint/no-explicit-any @@ -39,6 +43,8 @@ unitTest( const response = await fetch( "http://localhost:4545/multipart_form_data.txt", ); + assert(response.body instanceof ReadableStream); + const text = await response.text(); const body = buildBody(text, response.headers); @@ -56,6 +62,8 @@ unitTest( const response = await fetch( "http://localhost:4545/cli/tests/subdir/form_urlencoded.txt", ); + assert(response.body instanceof ReadableStream); + const text = await response.text(); const body = buildBody(text, response.headers); |