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
/** | |
* Created by amills001c on 2/25/16. | |
*/ | |
var test = require('ava'); | |
var fs = require('fs'); | |
/////////////////////////////////////////////////////////// |
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
// this looks to be a problem | |
//it will print "one" and "two", followed by "2 passed" | |
var test = require('ava'); | |
var fs = require('fs'); | |
var domain = require('domain'); |
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
var BufferStream = function () { | |
stream.Transform.apply(this, arguments); | |
this.sumanReady = false; | |
this.buffer = []; | |
}; | |
util.inherits(BufferStream, stream.Transform); | |
BufferStream.prototype._transform = function (chunk, encoding, done) { | |
// custom buffering logic |
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
try { | |
dir = sumanConfig.servers['*default'].outputDir; | |
outputPath = path.resolve(dir + '/' + timestamp); | |
fs.mkdir(outputPath, function (err) { | |
cb(err, false, outputPath); | |
}); | |
} | |
catch (err) { | |
console.error(err.stack); | |
cb(err, false); |
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 suman = require('suman'); | |
const Test = suman.init(module); | |
Test.describe('FirstExample', function(assert, path, http){ // this is our test suite, and we inject some core modules by name | |
this.beforeEach('runs before every it()', t => { |
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 suman = require('suman'); | |
const Test = suman.init(module); | |
Test.describe('SecondExample', function(db, someval, delay, assert){ // normally we only need to inject a couple of values per test | |
var results = []; |
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
define(['require'],function(require){ // 'require' is a reserved dependency keyword in RequireJS | |
var module = require('someModule'); //if we know for sure that someModule is already loaded, then we can load it here synchrounously | |
}); | |
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 suman = require('suman'); | |
const Test = suman.init(module); | |
Test.describe('Test inits', {parallel: false}, function (Pool, assert, path) { | |
const data = { | |
size: 5, | |
filePath: path.resolve(__dirname + '/fixtures/sample-file.js') | |
}; |
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
// => The Suman config file; should always remain at the root of your project | |
// => If transpile is true, Suman will put your babel deps in ~/.suman/node_modules | |
// => When you first install Suman, Suman will write a directory called "suman" to your project root, | |
// it is best practice to simply move the "suman" directory inside your "test" directory, | |
// when you move the "suman" directory, you must update the "sumanHelpersDir" property below to reflect the path | |
// from the project root to the "sumanHelpersDir" | |
// suman.conf.js uses some core utilities, you can change this logic at will |
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 Rx = require('rx-lite'); | |
const values = [1, 2, 3]; | |
const obs = Rx.Observable.from(values); | |
obs.subscribe( | |
function onNext(result) { | |
console.log('item =>', result); |