From aae99496507933a0139b61e76b18a9cb4e40b015 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C3=ABl=20Lemaire?= Date: Wed, 2 Dec 2020 21:58:26 +0100 Subject: [PATCH] Updated devtools --- comparison.test.ts | 8 ++++---- composition.test.ts | 10 +++++----- deps.test.ts | 2 +- iterables.test.ts | 14 +++++++------- objects.test.ts | 4 ++-- predicates.test.ts | 12 ++++++------ typing.test.ts | 10 +++++----- 7 files changed, 30 insertions(+), 30 deletions(-) diff --git a/comparison.test.ts b/comparison.test.ts index 8195e13..29505b0 100644 --- a/comparison.test.ts +++ b/comparison.test.ts @@ -1,14 +1,14 @@ -import { expect, test } from "./deps.test.ts"; import { bool, cmp, is } from "./comparison.ts"; +import { expect, it } from "./deps.test.ts"; -test("cmp", () => { +it("cmp", () => { expect([8, 3, 5].sort(cmp())).toEqual([3, 5, 8]); expect([8, 3, 5, 8].sort(cmp({ reverse: true }))).toEqual([8, 8, 5, 3]); expect([-2, 8, -7].sort(cmp({ key: Math.abs }))).toEqual([-2, -7, 8]); expect(["c", "a", "b"].sort(cmp())).toEqual(["a", "b", "c"]); }); -test("is", () => { +it("is", () => { const f1 = is(5); expect(f1(5)).toBe(true); expect(f1(4)).toBe(false); @@ -23,7 +23,7 @@ test("is", () => { expect(f2({ y: 1 } as any)).toBe(false); }); -test("bool", () => { +it("bool", () => { expect(bool(null)).toBe(false); expect(bool(undefined)).toBe(false); diff --git a/composition.test.ts b/composition.test.ts index a84b0e1..c3343bb 100644 --- a/composition.test.ts +++ b/composition.test.ts @@ -1,16 +1,16 @@ -import { expect, test } from "./deps.test.ts"; import { identity, nop, partial, pipe } from "./composition.ts"; +import { expect, it } from "./deps.test.ts"; -test("nop", () => { +it("nop", () => { expect(nop()).toBeUndefined(); }); -test("identity", () => { +it("identity", () => { expect(identity(5)).toBe(5); expect(identity(null)).toBe(null); }); -test("partial", () => { +it("partial", () => { const func1 = (conf: { a: number; b: string; c: number }) => `${conf.a}${conf.b}${conf.c}`; const pfunc1 = partial({ b: "test" }, func1); @@ -22,7 +22,7 @@ test("partial", () => { expect(pfunc2({ a: 2 }, 3)).toEqual("2test3"); }); -test("pipe", () => { +it("pipe", () => { const f = pipe((x: number) => x * 2, (x: number) => x + 1); expect(f(1)).toBe(3); expect(f(2)).toBe(5); diff --git a/deps.test.ts b/deps.test.ts index 0ad5f7d..c973a09 100644 --- a/deps.test.ts +++ b/deps.test.ts @@ -1 +1 @@ -export * from "https://code.thunderk.net/typescript/devtools/raw/1.0.0/testing.ts"; +export * from "https://code.thunderk.net/typescript/devtools/raw/1.2.2/testing.ts"; diff --git a/iterables.test.ts b/iterables.test.ts index 5ec7cdf..ad8b3bd 100644 --- a/iterables.test.ts +++ b/iterables.test.ts @@ -1,7 +1,7 @@ -import { expect, test } from "./deps.test.ts"; +import { expect, it } from "./deps.test.ts"; import { at, first, fmap, last, second, third } from "./iterables.ts"; -test("at", () => { +it("at", () => { const second = at(1); expect(second([1, 4, 8])).toBe(4); expect(second([1])).toBeUndefined(); @@ -11,31 +11,31 @@ test("at", () => { expect(second_from_end([1])).toBeUndefined(); }); -test("first", () => { +it("first", () => { expect(first([1, 4, 8])).toBe(1); expect(first([1])).toBe(1); expect(first([])).toBeUndefined(); }); -test("second", () => { +it("second", () => { expect(second([1, 4, 8])).toBe(4); expect(second([1])).toBeUndefined(); expect(second([])).toBeUndefined(); }); -test("third", () => { +it("third", () => { expect(third([1, 4, 8])).toBe(8); expect(third([1, 4])).toBeUndefined(); expect(third([])).toBeUndefined(); }); -test("last", () => { +it("last", () => { expect(last([1, 4, 8])).toBe(8); expect(last([1])).toBe(1); expect(last([])).toBeUndefined(); }); -test("fmap", () => { +it("fmap", () => { expect(fmap()([1, 2, 3])).toEqual([1, 2, 3]); expect(fmap((x: number) => x * 2)([1, 2, 3])).toEqual([2, 4, 6]); expect(fmap(undefined, (x: number) => x % 2 == 0)([1, 2, 3])).toEqual([2]); diff --git a/objects.test.ts b/objects.test.ts index 6cf8217..ad411c8 100644 --- a/objects.test.ts +++ b/objects.test.ts @@ -1,7 +1,7 @@ -import { expect, test } from "./deps.test.ts"; +import { expect, it } from "./deps.test.ts"; import { attr } from "./objects.ts"; -test("attr", () => { +it("attr", () => { const getx = attr("x"); expect(getx({ x: 4, y: 5 })).toBe(4); expect(getx({ x: undefined, y: 5 })).toBeUndefined(); diff --git a/predicates.test.ts b/predicates.test.ts index 2302b62..2482499 100644 --- a/predicates.test.ts +++ b/predicates.test.ts @@ -1,19 +1,19 @@ -import { expect, test } from "./deps.test.ts"; +import { expect, it } from "./deps.test.ts"; import { always, and, never, not, or } from "./predicates.ts"; -test("always", () => { +it("always", () => { expect(always()).toBe(true); expect(always(true)).toBe(true); expect(always(false)).toBe(true); }); -test("never", () => { +it("never", () => { expect(never()).toBe(false); expect(never(true)).toBe(false); expect(never(false)).toBe(false); }); -test("not", () => { +it("not", () => { const iseven = (x: number) => x % 2 == 0; const isodd = not(iseven); expect(iseven(0)).toBe(true); @@ -24,7 +24,7 @@ test("not", () => { expect(isodd(2)).toBe(false); }); -test("and", () => { +it("and", () => { const f = and((x: number) => x % 2 == 0, (x: number) => x > 5); expect(f(0)).toBe(false); expect(f(2)).toBe(false); @@ -33,7 +33,7 @@ test("and", () => { expect(f(10)).toBe(true); }); -test("or", () => { +it("or", () => { const f = or((x: number) => x % 2 == 0, (x: number) => x > 5); expect(f(0)).toBe(true); expect(f(1)).toBe(false); diff --git a/typing.test.ts b/typing.test.ts index 7121ee0..94e1738 100644 --- a/typing.test.ts +++ b/typing.test.ts @@ -1,7 +1,7 @@ -import { expect, test } from "./deps.test.ts"; +import { expect, it } from "./deps.test.ts"; import { isinstance, nn, nnu, nu } from "./typing.ts"; -test("isinstance", () => { +it("isinstance", () => { class A {} class A1 extends A {} class A2 extends A {} @@ -12,7 +12,7 @@ test("isinstance", () => { expect(result).toEqual([f[3], f[4], f[6]]); }); -test("nn", () => { +it("nn", () => { expect(nn(undefined)).toBeUndefined(); expect(nn(0)).toBe(0); expect(nn("")).toBe(""); @@ -20,7 +20,7 @@ test("nn", () => { expect(() => nn(null)).toThrow("null value"); }); -test("nu", () => { +it("nu", () => { expect(nu(null)).toBe(null); expect(nu(0)).toBe(0); expect(nu("")).toBe(""); @@ -28,7 +28,7 @@ test("nu", () => { expect(() => nu(undefined)).toThrow("undefined value"); }); -test("nnu", () => { +it("nnu", () => { expect(nnu(0)).toBe(0); expect(nnu("")).toBe(""); expect(nnu([])).toEqual([]);