mirror of
https://github.com/denoland/std.git
synced 2024-11-22 04:59:05 +00:00
c46143f0ac
* chore: update copyright year * fix --------- Co-authored-by: Asher Gomez <ashersaupingomez@gmail.com>
16 lines
534 B
TypeScript
16 lines
534 B
TypeScript
// Copyright 2018-2024 the Deno authors. All rights reserved. MIT license.
|
|
|
|
import { assertEquals } from "../assert/assert_equals.ts";
|
|
import { toText } from "./to_text.ts";
|
|
|
|
Deno.test("[streams] toText", async () => {
|
|
const byteStream = ReadableStream.from(["hello", " js ", "fans"])
|
|
.pipeThrough(new TextEncoderStream());
|
|
|
|
assertEquals(await toText(byteStream), "hello js fans");
|
|
|
|
const stringStream = ReadableStream.from(["hello", " deno ", "world"]);
|
|
|
|
assertEquals(await toText(stringStream), "hello deno world");
|
|
});
|