Giter Site home page Giter Site logo

f-mocha's Introduction

f-mocha

Mocha wrapper for f-promise

f-mocha is a companion package for f-promise. It provides the small wrapper which is needed to run unit tests written with mocha and f-promise.

Installation

npm install --save-dev f-mocha

Usage

Just run Mocha with the following argument

mocha --ui f-mocha

Now you can write your tests as if they were all synchronous. See this unit test for an example.

License

MIT.

f-mocha's People

Contributors

bjouhier avatar tchambard avatar blaky avatar

Stargazers

Raboliot le gris avatar

Watchers

James Cloos avatar Stewart Collins avatar Matt Turner avatar Rachel Shi avatar Steven Brown avatar Kevin Reece avatar  avatar

f-mocha's Issues

it.skip and it.only are not functions

@bjouhier
Hi Bruno,

When using f-mocha, it is not possible to use inclusive and exclusive test with skip and only keywords on it declarations.
Do you think it would be possible to manage this need without too many changes ?

Thanks by advance
Teddy

Make the setup automatic and without requiring mocha to be initialized

To use f-mocha you have to import the module and explicitly call setup and this has to be done inside of at least one of the test cases. If you look at how co-mocha achieves the same thing, they do it in a way where no explicit setup is required and it has the benefit that this can be done before mocha is initialized.

We run our tests and have a --require in our mocha.opts file that loads a test initialization file anytime a test is executed without having to repeat that initialization in every test. This is where we put the initialization call to co-mocha. If I put your setup call for f-mocha in that code it fails because mocha hasn't initialized yet and the functions you are looking for do not yet exist in the global namespace. The co-mocha library seems to have found a way around that (https://github.com/blakeembrey/co-mocha/blob/master/lib/co-mocha.js#L53).

An alternative to consider.

Licence?

Hi,

There is no LICENCE file nor any mention in the Readme. Is it MIT?

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.