Last active
January 4, 2016 10:38
-
-
Save lukelex/8609672 to your computer and use it in GitHub Desktop.
Stik.js test setup experiments
This file contains hidden or 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
stik.controller("AppCtrl", "List", function($template, CustomFunc){}); | |
var lab = new stik.Lab({ | |
// string or nodeElm | |
env: "<div data-controller=\"AppCtrl\" data-action=\"List\">...</div>", | |
// controller or behavior | |
type: "controller", | |
name: "AppCtrl", | |
action: "List", | |
injection: { | |
CustomFunc: function(){} | |
} | |
}); | |
var lab = new stik.Lab({ | |
// controller or behavior | |
type: "controller", | |
name: "AppCtrl", | |
action: "List", | |
injection: [ | |
// string or nodeElm | |
"<div data-controller=\"AppCtrl\" data-action=\"List\">...</div>", | |
// double or actual func | |
someMockFunc | |
] | |
}); | |
var lab = new stik.Lab({ | |
// controller or behavior | |
type: "controller", | |
name: "AppCtrl", | |
action: "List", | |
}).$inject = ["<div data-controller=\"AppCtrl\" data-action=\"List\">...</div>", someMockFunc]; | |
lab.run | |
// do a bunch of assertions on the mocks or the template |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment