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
33 lines (27 loc) · 794 Bytes
/
Copy pathMain.fs
File metadata and controls
33 lines (27 loc) · 794 Bytes
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
module Fable.Tests.DefineConstants.DebugWithExtraDefines
open Fable.Core
open Fable.Core.JsInterop
open Fable.Core.Testing
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 equals expected actual = Assert.AreEqual(actual, expected)
describe "DebugWithExtraDefines" (fun () ->
let isDefined = "is defined"
let notDefined = "not defined"
it "should define DEBUG" (fun () ->
#if DEBUG
isDefined
#else
notDefined
#endif
|> equals isDefined
)
it "should define FOOBAR" (fun () ->
#if FOOBAR
isDefined
#else
notDefined
#endif
|> equals isDefined
)
)