Code Monkey home page Code Monkey logo

mocha-cloud-grid-view's Introduction

Mocha cloud GridView

Terminal "grid" view for mocha-cloud.

mocha cloud testing mocha cloud failures

Installation

$ npm install mocha-cloud-grid-view

Example

/**
 * Module dependencies.
 */

var Canvas = require('term-canvas')
  , size = process.stdout.getWindowSize()
  , Cloud = require('mocha-cloud')
  , GridView = require('mocha-cloud-grid-view');

var cloud = new Cloud('project name', 'your username here', 'your access key here');

// the browsers to test

cloud.browser('iphone', '5.0', 'Mac 10.6');
cloud.browser('iphone', '5.1', 'Mac 10.8');
cloud.browser('iphone', '6', 'Mac 10.8');
cloud.browser('ipad', '5.1', 'Mac 10.8');
cloud.browser('ipad', '6', 'Mac 10.8');
cloud.browser('safari', '5', 'Mac 10.6');
cloud.browser('chrome', '', 'Mac 10.8');
cloud.browser('firefox', '15', 'Windows 2003');
cloud.browser('firefox', '16', 'Windows 2003');
cloud.browser('firefox', '17', 'Windows 2003');

// the local url to test

cloud.url('http://localhost:3000/test/');

// setup

var canvas = new Canvas(size[0], size[1]);
var ctx = canvas.getContext('2d');
var grid = new GridView(cloud, ctx);
grid.size(canvas.width, canvas.height);
ctx.hideCursor();

// trap SIGINT

process.on('SIGINT', function(){
  ctx.reset();
  process.nextTick(function(){
    process.exit();
  });
});

// output failure messages
// once complete, and exit > 0
// accordingly

cloud.start(function(){
  grid.showFailures();
  setTimeout(function(){
    ctx.showCursor();
    process.exit(grid.totalFailures());
  }, 100);
});

License

MIT

mocha-cloud-grid-view's People

Contributors

tj avatar

Watchers

Jared Hanson avatar James Cloos avatar  avatar

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.