Skip to content

Commit

Permalink
test: add each test case
Browse files Browse the repository at this point in the history
  • Loading branch information
ppeeou committed Dec 3, 2021
1 parent b240390 commit c3953aa
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@fxts/core",
"version": "0.2.2",
"version": "0.2.3",
"description": "",
"type": "module",
"main": "dist/cjs/index.js",
Expand Down
8 changes: 5 additions & 3 deletions type-check/each.test.ts
Original file line number Diff line number Diff line change
@@ -1,14 +1,16 @@
import * as Test from "../src/types/Test";
import { each, pipe, toAsync } from "../src";
import { each, pipe, take, toAsync } from "../src";

const { checks, check } = Test;

const res1 = each(console.log, [1, 2, 3]);
const res2 = pipe([1, 2, 3], each(console.log));
const res3 = pipe([1, 2, 3], toAsync, each(console.log));
const res3 = pipe([1, 2, 3], take(1), each(console.log));
const res4 = pipe([1, 2, 3], toAsync, each(console.log));

checks([
check<typeof res1, void, Test.Pass>(),
check<typeof res2, void, Test.Pass>(),
check<typeof res3, Promise<void>, Test.Pass>(),
check<typeof res3, void, Test.Pass>(),
check<typeof res4, Promise<void>, Test.Pass>(),
]);

0 comments on commit c3953aa

Please sign in to comment.