GithubHelp home page GithubHelp logo

litmus's Introduction

Litmus

Build Status

Simple Clojurescript bindings for Mocha.js, Chai.js, smoax and others.

Usage

Add dependency

[litmus "0.4.1"]

To your project clj.

Litmus is self-testing - see resources/ for test HTML, project.clj for Leiningen setup and test for example tests.

Features

  • Basic test running with either describe-it style or describe-given-then style
  • Asynchronous test support (via before-each!, before! etc.)
  • AJAX mocking support via smoax (via with-ajax-mocks, ajax-called?, ajax-called-with-json? etc.)
  • Simple DOM matchers (does-exist?, is-visible? etc.)

Dependencies

For running tests

  • Node.js
  • Mocha-phantomjs
  • jayq

For test HTML page

Initial setup

Update submodules

git submodule init
git submodule update

Install mocha-phantomjs

npm install -g mocha
npm install -g mocha-phantomjs

Usage

Use leiningen

lein test

Or, call mocha-phantomjs directly

lein cljsbuild once
mocha-phantomjs resources/test.html

Contributors

  • Harri Salokorpi (Author)
  • Jori Ahvonen

Backlog

  • Helpers for conditionally running tests on (production) page. Url parameter http://...?test -> tests and deps are loaded - WIP -> topic/conditional_integration
  • Integrate Sinon.js to provide mocks/spies - WIP -> topic/mocks
  • Example project (for testing integration and as documentation)
  • Add more assertions (see Chai Asserts module)
  • Add support for async testing (macro-variants providing the done-callback)
  • Compile using :foreign-libs, integrating the dependencies to test framework (less setup on new project). Licences?

License

Copyright © 2013 Harri Salokorpi

Distributed under the Eclipse Public License, the same as Clojure.

litmus's People

Contributors

hsalokor avatar wolverian avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar

Watchers

 avatar

Forkers

wolverian

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.