Package

purescript-phantom

Repository
Risto-Stevcev/purescript-phantom
License
MIT
Uploaded by
Risto-Stevcev

Purescript bindings to PhantomJS

PhantomJS logo

Motive

Purescript code is pure and total, so most testing is usually a form of documentation or done with generative tests. However, occasionally tests need to test FFI bindings, which is where PhantomJS comes in handy. If you need to test some code that deals with Window, or the DOM, or some web APIs, these bindings come in handy. It can be used as a simpler replacement to the karma test-runner framework.

Example

Install phantomjs-prebuilt from npm, and run pulp run or pulp test with --runtime ./node_modules/.bin/phantomjs

import Prelude ((>>=), bind)
import Data.Enum (fromEnum)
import ExitCodes (ExitCode(Success))
import PhantomJS.Phantom (version, exit)
import Control.Monad.Eff.Console (logShow)

main = do
  version >>= logShow
  exit (fromEnum Success)
Modules
PhantomJS.Phantom
Dependencies