Last active
February 13, 2016 20:33
-
-
Save ORESoftware/35305f45f6eea17de83f to your computer and use it in GitHub Desktop.
Suman parallel example
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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