diff options
| author | Akshay Nair <phenax5@gmail.com> | 2023-01-13 19:40:15 +0530 |
|---|---|---|
| committer | Akshay Nair <phenax5@gmail.com> | 2023-01-13 19:59:56 +0530 |
| commit | 42f8c401dc9519bc8b2d386ce9eda072144a46d0 (patch) | |
| tree | e886538eccbd47beaaf27deff69267bd8c7dd67d /examples | |
| parent | 8ba316461d2dc0a1372af16836ce14ceabc2bf4f (diff) | |
| download | ts-types-lang-42f8c401dc9519bc8b2d386ce9eda072144a46d0.tar.gz ts-types-lang-42f8c401dc9519bc8b2d386ce9eda072144a46d0.zip | |
feat: refactors test runner
Diffstat (limited to 'examples')
| -rw-r--r-- | examples/test-runner.ts | 50 |
1 files changed, 30 insertions, 20 deletions
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<this['input']> -} +type testSomeStuff = Do<[ + PutStringLn<"Some Stuff">, -export type main = [ - SetEvalEnvironment<'test.node'>, - - PutStringLn<"Running tests...">, + Test<"should do some stuff", [ + Assert<Equals<1, 1>>, + Assert<Not<Equals<2, 1>>>, + ]>, - Do<[ - Test<"should do some stuff", [ - Assert<Equals<1, 2>>, - Assert<Not<Equals<2, 1>>>, - ]>, + Test<"bing bong, bing bing bong", [ + Assert<Equals<1, 1>>, + ]>, +]> - Test<"hello world", [ - Assert<Equals<1, 1>>, - ]>, +type testSomeMoreStuff = Do<[ + PutStringLn<"Other stuff?">, - Test<"should do some other stuff", [ - Assert<Equals<1, 1>>, - ]>, + Test<"should do some other stuff", [ + Assert<Equals<[1, 2, 3], [1, 2, 3]>>, ]>, + + // Test<"this'll fail fo sho", [ + // Assert<Equals<[1, 2, 3], [4, 5, 6]>>, + // ]>, +]> + +export type main = [ + // Update env to node with test helpers + SetEvalEnvironment<'test.node'>, + + PutStringLn<"=== Running tests... ===\n">, + + testSomeStuff, + testSomeMoreStuff, ] |
