Skip to content

Instantly share code, notes, and snippets.

View tivac's full-sized avatar
💭
👋🏻🙃

Pat Cavit tivac

💭
👋🏻🙃
View GitHub Profile
@tivac
tivac / reporter.js
Last active August 29, 2015 14:07
Sweetie.js, an experiment in tiny test-runner creation
var sweetie = Sweetie.globalize(),
output = "",
start = Date.now(),
failures, passed;
sweetie.run(function(status, test, args) {
if(status === "finish") {
output += "\n\nTests completed in " + (Date.now() - start) + "ms";
return JS.reply({
YUI.add('dav', function(Y) {
Y.Dav = function() {
function _func(args) {
return true;
}
var _foo = "bar";
return {
_func : myFunction,
YUI({ base : 'js/yahoo/', filter : 'raw' }).use('Config', 'Lib1', 'Lib2', function(Y) {
var config = new Y.Config();
var lib1 = new Y.Lib1(config);
var lib2 = new Y.Lib2(config);
});
YUI.add('Config', function(Y) {
var Config = {
data : null,
defaultConfig : {
test : 'what'
},
read : function() {
...
},
YUI.add('Lib', function(Y) {
Y.Lib = function() {
var foo = Y.Config.data.bar
};
}, '.01', { requires : [ 'Config' ] });
YUI().use('Config', 'Lib', function(Y) {
var lib = new Y.Lib();
});
YUI().use('node', function(Y) {
YUI.namespace("Test");
YUI.Test = function() {
var shared = 1;
function increase() {
shared++;
}
YAHOO.yv.props = {
"is_home" : true,
"bcrumb" : "64871846ad00b86e77cf1fc858f6762f,1,1233598320",
"spaceid" : "792730243",
"lang" : "en-US",
"region" : "us",
"videos" : {
var props = YAHOO.yv.props;
if(props.is_home) {
//do home page specific stuff here
}
YUI.add('config', function(Y) {
Y.Config = function() {
var conf;
function _parse() {
try {
conf = Y.JSON.parse("{ \"foo\" : 1, \"foo2\" : 2 }");
} catch(e) {
console.log("Error Parsing");
}