From 42f8c401dc9519bc8b2d386ce9eda072144a46d0 Mon Sep 17 00:00:00 2001 From: Akshay Nair Date: Fri, 13 Jan 2023 19:40:15 +0530 Subject: feat: refactors test runner --- examples/test-runner.ts | 50 +++++++++++++++++++++++++++++-------------------- 1 file changed, 30 insertions(+), 20 deletions(-) (limited to 'examples') diff --git a/examples/test-runner.ts b/examples/test-runner.ts index 3302fbb..081dede 100644 --- a/examples/test-runner.ts +++ b/examples/test-runner.ts @@ -1,30 +1,40 @@ -import { Do, Kind1 } from '../stdlib/effect' -import { Print, PutStringLn } from '../stdlib/stdio' +import { Do } from '../stdlib/effect' +import { PutStringLn } from '../stdlib/stdio' import { SetEvalEnvironment } from '../stdlib/sys' import { Test, Assert } from '../stdlib/test' import { Equals, Not } from '../stdlib/util' -interface PrintK extends Kind1 { - return: Print -} +type testSomeStuff = Do<[ + PutStringLn<"Some Stuff">, -export type main = [ - SetEvalEnvironment<'test.node'>, - - PutStringLn<"Running tests...">, + Test<"should do some stuff", [ + Assert>, + Assert>>, + ]>, - Do<[ - Test<"should do some stuff", [ - Assert>, - Assert>>, - ]>, + Test<"bing bong, bing bing bong", [ + Assert>, + ]>, +]> - Test<"hello world", [ - Assert>, - ]>, +type testSomeMoreStuff = Do<[ + PutStringLn<"Other stuff?">, - Test<"should do some other stuff", [ - Assert>, - ]>, + Test<"should do some other stuff", [ + Assert>, ]>, + + // Test<"this'll fail fo sho", [ + // Assert>, + // ]>, +]> + +export type main = [ + // Update env to node with test helpers + SetEvalEnvironment<'test.node'>, + + PutStringLn<"=== Running tests... ===\n">, + + testSomeStuff, + testSomeMoreStuff, ] -- cgit v1.3.1