Skip to content

Commit

Permalink
BREAKING(testing/asserts): remove implicit any types from assert sign…
Browse files Browse the repository at this point in the history
…atures. (#2203)
jespertheend authored May 20, 2022
1 parent ce671db commit 11b2b7f
Showing 9 changed files with 117 additions and 154 deletions.
5 changes: 4 additions & 1 deletion archive/tar_test.ts
Original file line number Diff line number Diff line change
@@ -13,6 +13,7 @@ import { assert, assertEquals } from "../testing/asserts.ts";

import { dirname, fromFileUrl, resolve } from "../path/mod.ts";
import { Tar, Untar } from "./tar.ts";
import type { TarMeta } from "./tar.ts";
import { Buffer } from "../io/buffer.ts";
import { copy, readAll } from "../streams/conversion.ts";

@@ -317,7 +318,9 @@ Deno.test("untarLinuxGeneratedTar", async function () {
const filePath = resolve(testdataDir, "deno.tar");
const file = await Deno.open(filePath, { read: true });

const expectedEntries = [
type ExpectedEntry = TarMeta & { content?: Uint8Array };

const expectedEntries: ExpectedEntry[] = [
{
fileName: "archive/",
fileSize: 0,
2 changes: 1 addition & 1 deletion collections/deep_merge_test.ts
Original file line number Diff line number Diff line change
@@ -95,7 +95,7 @@ Deno.test("deepMerge: prevent calling Object.prototype.__proto__ accessor proper
configurable: true,
});
try {
assertEquals(
assertEquals<unknown>(
deepMerge({
foo: true,
}, {
2 changes: 1 addition & 1 deletion collections/first_not_nullish_of_test.ts
Original file line number Diff line number Diff line change
@@ -5,7 +5,7 @@ import { firstNotNullishOf } from "./first_not_nullish_of.ts";

function firstNotNullishOfTest<T, O>(
input: [Array<T>, (el: T) => O | undefined | null],
expected: O,
expected: NonNullable<O> | undefined,
message?: string,
) {
const actual = firstNotNullishOf(...input);
2 changes: 1 addition & 1 deletion encoding/_toml/parser_test.ts
Original file line number Diff line number Diff line change
@@ -359,7 +359,7 @@ Deno.test({
email: {
x: { main: "mail@example.com" },
},
},
} as unknown,
},
],
},
2 changes: 1 addition & 1 deletion encoding/jsonc_test.ts
Original file line number Diff line number Diff line change
@@ -120,7 +120,7 @@ Deno.test({
const json = JSON.parse('{"__proto__": 100}');
const jsonc = JSONC.parse('{"__proto__": 100}');
assertEquals(jsonc, json);
assertEquals((jsonc as Record<string, string>).__proto__, 100);
assertEquals((jsonc as Record<string, number>).__proto__, 100);
assertEquals((jsonc as Record<string, string>).__proto__, json.__proto__);
assertStrictEquals(Object.getPrototypeOf(jsonc), Object.prototype);
assertStrictEquals(
Loading
Oops, something went wrong.

0 comments on commit 11b2b7f

Please sign in to comment.