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
/* | |
Error that I get for both these attempts: | |
"Missing required parameter - file" | |
the image is in a base64 string format... | |
*/ |
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 viking = require('viking'); //we have published viking on NPM and then installed it in the local project with the --save option | |
viking.start(); | |
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 viking = require('viking'); //we have published viking on NPM and then installed it in the local project with the --save option | |
viking.start(); | |
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 | |
//if we know for sure that some-module is already loaded, then we can load it here synchrounously | |
//we don't even need to reference it in the dependency array above, if we know it's already loaded | |
var module = require('some-module'); | |
}); |
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) { |
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) { |
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); | |
Test.describe('SimpleExampleA', function () { | |
var config = null; |
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'); | |
const Test = suman.init(module,'suman.conf.js'); //we now utilize a suman config file which is useful for configuring reporting, IoC, etc | |
Test.describe('SecondExample', ['delay', 'db', 'val'], function(delay, db, val){ // 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
const assert = require('assert'); | |
const suman = require('suman'); | |
const Test = suman.init(module,'suman.conf.js'); //we now utilize a suman config file which is useful for configuring reporting, IoC, etc | |
Test.describe('SecondExample', function(db, server, request){ // normally we only need to inject a couple of values per test, and we don't really need the dependency array | |
assert(server.isListening); // values are injected asynchronously, so we are already ready to go | |
assert(db.isConnected); // values are injected asynchronously, so we are already ready to go |
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
//use your own version of this file at the root of your project to configure dependency injection | |
module.exports = (suman) => { //load async deps for any of your suman tests | |
suman.configure({ | |
'request': function () { | |