Module

Solid.Testing

Package
purescript-purs-solid
Repository
arazorda/purs-solid

Helpers for testing views in a DOM (a browser, or happy-dom / jsdom). Diagnostics need Solid's dev build (the development export condition).

#settle Source

settle :: Aff Unit

Applies pending writes, lets queued work run, and applies what it wrote.

#Mounted Source

type Mounted = { dispose :: Effect Unit, root :: Element }

#mount Source

mount :: JSX -> Aff Mounted

Renders into a fresh container appended to document.body. dispose unmounts it and removes the container.

#mountUsing Source

mountUsing :: (JSX -> Element -> Effect (Either Error (Effect Unit))) -> JSX -> Aff Mounted

mount with another render function, e.g. Solid.Web.renderWith options.

#html Source

html :: Mounted -> Aff String

The container's HTML once settled.

#inputText Source

inputText :: String -> Element -> Effect Unit

Sets an input's value and dispatches an input event.

#Diagnostic Source

type Diagnostic = { code :: String, message :: String, severity :: String }

#collectDiagnostics Source

collectDiagnostics :: Effect (Effect (Array Diagnostic))

Starts collecting Solid's diagnostics; the returned effect stops and returns them.

#ignoreDiagnostic Source

ignoreDiagnostic :: String -> Effect Unit

Drops diagnostics with this code from every running collection, e.g. once a test has checked that it was reported.