Fix eslint warnings (#2151)

Co-authored-by: Bartek Iwańczuk <biwanczuk@gmail.com>
Co-authored-by: LE GOFF Vincent <g_n_s@hotmail.fr>
This commit is contained in:
Ryan Dahl 2019-04-21 16:40:10 -04:00 committed by GitHub
parent 6cded14bdf
commit 9dfebbc949
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
75 changed files with 1110 additions and 931 deletions

View file

@ -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]");