Git Product home page Git Product logo

test.it's Introduction

test.it

TDD testing framework.

Availible in nodejs

Goals:

  • to use dev console instead of page DOM (in browser)
  • to avoid crashes
  • to avoid differences in results of tests of one and the same code
  • to provide the ease of use
  • to provide async testing
  • to provide particular output
  • multilevel nesting
  • chaining

Techniques:

  • OOP
  • Strategy pattern

Test types

  • validity of expression or value
  • equality between 2 or more values
  • constructor (type) of value

===

How to install

There are some differences between usage test.it in different environment like browser or nodejs.

Browser

  • First: add core of framework

    <script src='path/to/test.it.js'></script>
  • Next: add output strategy and set firebugConsole as default printer

    <script src='path/to/test.it-firebug.js'></script>
    <script>test.printer(firebugConsole);</script>

    Of course you can include test.printer(firebugConsole); in your tests script.

Hint: add <script> tags to the end of your <body> tag.

btw you can use this construction:

<!-- framework -->
<script src='./test.it.js'></script>
<!-- print to firebug console -->
<script src='./test.it-firebug.js'></script>
<!-- set firebugConsole as default printer  -->
<script>test.printer(firebugConsole);</script>
<!-- your script -->
<script src='./script.js'></script>
<!-- your tests -->
<script src='./tests.js'></script>
<!-- a trick to not worry about the call of test.print() -->
<script>test.print();</script>

Nodejs

  • First: install framework and output module

    npm install 'test.it'
    npm install 'test.it-nodejs'

    Hint: you can use -g flag to install them globally

  • Second: add core of framework and output module, set it as default printer

    test = require('test.it');
    nodeConsole = require('test.it-nodejs');
    test.printer(nodeConsole);

    btw you can use this construction:

    (test = require('test.it')).printer(require('test.it-nodejs'));

    Info: Output module is not required! You can use test.it without any output at all.

    It's repo takes place here

===

How to use

You can find the API manual on wiki

Online demo

Look at it right here

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.