From cd67f7bdc8fbf1caef758113bab97cc6396321dc Mon Sep 17 00:00:00 2001 From: Kurt Mackey Date: Thu, 20 Aug 2020 11:47:58 -0400 Subject: fix: Create body stream from any valid bodySource (#7128) Fixes #6752 --- cli/tests/unit/body_test.ts | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) (limited to 'cli/tests') 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); -- cgit v1.2.3