forked from fable-compiler/Fable
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMain.fs
More file actions
96 lines (83 loc) · 1.93 KB
/
Copy pathMain.fs
File metadata and controls
96 lines (83 loc) · 1.93 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
module Fable.Tests.TypeScript.Main
open System
open Fable.Tests
let allTests =
[|
UtilTests.tests
Applicative.tests
Arithmetic.tests
Arrays.tests
Async.tests
Chars.tests
Comparison.tests
ConditionalWeakTable.tests
Convert.tests
CustomOperators.tests
DateTimeOffset.tests
DateTime.tests
DateOnly.tests
Dictionaries.tests
#if FABLE_COMPILER
ElmishParser.tests
#endif
Enumerable.tests
Enum.tests
Event.tests
HashSets.tests
// Import.tests
// JsInterop.tests
LiteTsInterop.tests
Lists.tests
Maps.tests
Misc.tests
NestedAndRecursivePatternTests.tests
Observable.tests
Option.tests
Queue.tests
RecordTypes.tests
Reflection.tests
Regex.tests
ResizeArrays.tests
Result.tests
SeqExpressions.tests
Seqs.tests
Sets.tests
Stack.tests
Strings.tests
Sudoku.tests
TailCalls.tests
TimeOnly.tests
TimeSpan.tests
TupleTypes.tests
TypeTests.tests
UnionTypes.tests
Uri.tests
|]
#if FABLE_COMPILER || FABLE_COMPILER_TYPESCRIPT
open Fable.Core
open Fable.Core.JsInterop
// Import a polyfill for atob and btoa, used by fable-library
// but not available in node.js runtime
importSideEffects "../Js/Main/js/polyfill.js"
let inline describe (name: string) (f: unit->unit) : unit = import "describe" "node:test"
let inline it (msg: string) (f: unit->unit) : unit = import "it" "node:test"
let rec flattenTest (test: Util.Testing.TestKind) : unit =
match test with
| Util.Testing.TestKind.TestList(name, tests) ->
describe name (fun () ->
for t in tests do
flattenTest t)
| Util.Testing.TestKind.TestCase (name, test) ->
it name (unbox test)
let run () =
for t in allTests do
flattenTest t
run()
#else
open Expecto
[<EntryPoint>]
let main args =
Array.toList allTests
|> testList "All"
|> runTestsWithCLIArgs [] args
#endif