diff options
Diffstat (limited to 'js/text_encoding_test.ts')
-rw-r--r-- | js/text_encoding_test.ts | 20 |
1 files changed, 10 insertions, 10 deletions
diff --git a/js/text_encoding_test.ts b/js/text_encoding_test.ts index d33537b4f..f015a9452 100644 --- a/js/text_encoding_test.ts +++ b/js/text_encoding_test.ts @@ -1,19 +1,19 @@ // Copyright 2018-2019 the Deno authors. All rights reserved. MIT license. import { test, assert, assertEquals } from "./test_util.ts"; -test(function atobSuccess() { +test(function atobSuccess(): void { const text = "hello world"; const encoded = btoa(text); assertEquals(encoded, "aGVsbG8gd29ybGQ="); }); -test(function btoaSuccess() { +test(function btoaSuccess(): void { const encoded = "aGVsbG8gd29ybGQ="; const decoded = atob(encoded); assertEquals(decoded, "hello world"); }); -test(function btoaFailed() { +test(function btoaFailed(): void { const text = "你好"; let err; try { @@ -25,7 +25,7 @@ test(function btoaFailed() { assertEquals(err.name, "InvalidInput"); }); -test(function textDecoder2() { +test(function textDecoder2(): void { // prettier-ignore const fixture = new Uint8Array([ 0xf0, 0x9d, 0x93, 0xbd, @@ -37,13 +37,13 @@ test(function textDecoder2() { assertEquals(decoder.decode(fixture), "𝓽𝓮𝔁𝓽"); }); -test(function textDecoderASCII() { +test(function textDecoderASCII(): void { const fixture = new Uint8Array([0x89, 0x95, 0x9f, 0xbf]); const decoder = new TextDecoder("ascii"); assertEquals(decoder.decode(fixture), "‰•Ÿ¿"); }); -test(function textDecoderErrorEncoding() { +test(function textDecoderErrorEncoding(): void { let didThrow = false; try { new TextDecoder("foo"); @@ -54,7 +54,7 @@ test(function textDecoderErrorEncoding() { assert(didThrow); }); -test(function textEncoder2() { +test(function textEncoder2(): void { const fixture = "𝓽𝓮𝔁𝓽"; const encoder = new TextEncoder(); // prettier-ignore @@ -66,7 +66,7 @@ test(function textEncoder2() { ]); }); -test(function textDecoderSharedUint8Array() { +test(function textDecoderSharedUint8Array(): void { const ab = new SharedArrayBuffer(6); const dataView = new DataView(ab); const charCodeA = "A".charCodeAt(0); @@ -79,7 +79,7 @@ test(function textDecoderSharedUint8Array() { assertEquals(actual, "ABCDEF"); }); -test(function textDecoderSharedInt32Array() { +test(function textDecoderSharedInt32Array(): void { const ab = new SharedArrayBuffer(8); const dataView = new DataView(ab); const charCodeA = "A".charCodeAt(0); @@ -92,7 +92,7 @@ test(function textDecoderSharedInt32Array() { assertEquals(actual, "ABCDEFGH"); }); -test(function toStringShouldBeWebCompatibility() { +test(function toStringShouldBeWebCompatibility(): void { const encoder = new TextEncoder(); assertEquals(encoder.toString(), "[object TextEncoder]"); |