Skip to content

Instantly share code, notes, and snippets.

@ORESoftware
Last active February 13, 2016 20:33
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ORESoftware/35305f45f6eea17de83f to your computer and use it in GitHub Desktop.
Save ORESoftware/35305f45f6eea17de83f to your computer and use it in GitHub Desktop.
Suman parallel example
const assert = require('assert');
const suman = require('suman');
/////////////////////////////////////////////////////
var Test = suman.init(module);
/////////////////////////////////////////////////////
function promiseTimeout(t) {
process.stdout.write('begin: ' + t.desc + '\n');
return new Promise(function (resolve) {
setTimeout(function () {
process.stdout.write('end: ' + t.desc + '\n');
resolve();
}, Math.random() * 1000);
})
}
Test.describe('@Test1', {parallel: true}, function () {
this.it('one', t => {
return promiseTimeout(t);
});
this.it('two', t => {
return promiseTimeout(t);
});
this.it('three', t => {
return promiseTimeout(t);
});
this.it('four', (t) => {
return promiseTimeout(t);
});
this.it('five', t => {
return promiseTimeout(t);
});
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment