Installing purescript-spec-mocha using spago


I’m new to PureScript and mostly loving it, but a bit confused by packaging/installation. I’m using spago, and I believe bower is “deprecated” (although most packages on Pursuit seem to specify installation using bower, so that’s one of the things that confuses me).

Anyway, I’m able to install purescript-spec using spago install spec, but don’t know how to install purescript-spec-mochaspago install spec-mocha doesn’t work, and no installation instructions are provided for anything other than bower.

How do I do this? Is there a way to tell spago how to find the relevant repo?


Ok, I manually added

  { spec-mocha =
      { dependencies =
          [ "exceptions"
          , "console"
          , "foldable-traversable"
          , "spec"
      , repo =
      , version =

to additions in packages.dhall, and that worked. Is there a better way?

That means that spec-mocha isn’t in the official package set. One way to improve this is to add it! Here are the instructions:

This is the file for purescript-spec:

You can add spec-mocha to this file as well, which is pretty much just copying over the code snippet you’ve already posted here. Once the package is in the package set you no longer need it in your additions.


Thanks for that. I’ll consider adding it to package-set if I can get it working. (The documentation seems to be out of date and at runtime it fails with “Mocha globals seem to be unavailable!”, so it might not be wise to add this to a curated list of packages until I better understand what’s going on.)

Adding it to your additions is indeed the intended approach if you’re not adding it to the upstream package set, yes:

Cool, thanks for clarifying. I managed to get it working (after a huge amount of trial-and-error, to be fair much of not to do with this package, but rather the vagaries of working with Karma, Mocha and whatnot), so I may still bump it up to the package set.