-
Notifications
You must be signed in to change notification settings - Fork 17
/
Copy pathMain.purs
29 lines (23 loc) · 1.19 KB
/
Main.purs
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
module Test.Main where
import Prelude (Unit)
import Control.Monad.Eff (Eff)
import Control.Monad.Eff.Console (CONSOLE)
import Node.Process (PROCESS)
import Data.Argonaut.Encode.Combinators ((~>), (:=))
import Data.Argonaut.Core (jsonEmptyObject)
import Test.Spec (it, describe)
import Test.Spec.Assertions (shouldEqual)
import Test.Spec.Reporter.Console (consoleReporter)
import Test.Spec.Runner (run)
import Electron.BrowserWindow (BrowserWindowOption(WebPreferences, Height, Width), WebPreference(OverlayScrollbars))
import Electron.Options (encodeOptions)
main :: forall eff. Eff (process :: PROCESS, console :: CONSOLE | eff) Unit
main = run [consoleReporter] do
describe "encodeOptions :: BrowserWindowOptions -> Json" do
it "can encode all options" do
let options = [Width 640, Height 480, WebPreferences [OverlayScrollbars true]]
encodeOptions options `shouldEqual` ( "width" := 640
~> "height" := 480
~> "webPreferences" := ( "overlayScrollbars" := true
~> jsonEmptyObject )
~> jsonEmptyObject )