mocha-cloud-grid-view
Mocha grid view for mocha-cloud
Last updated 8 years ago by tjholowaychuk .
Original npm · Tarball · package.json
$ cnpm install mocha-cloud-grid-view 
SYNC missed versions from official npm registry.

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

Current Tags

  • 0.0.1                                ...           latest (8 years ago)

1 Versions

  • 0.0.1                                ...           8 years ago
Maintainers (1)
Downloads
Today 0
This Week 0
This Month 0
Last Day 0
Last Week 0
Last Month 2
Dependencies (2)
Dev Dependencies (1)
Dependents (2)

Copyright 2014 - 2016 © taobao.org |