Skip to content

tj/mocha-cloud-grid-view

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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

About

Terminal browser grid view for "mocha cloud" testing

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published