Skip to content

Instantly share code, notes, and snippets.

@lukelex
Last active January 4, 2016 10:38
Show Gist options
  • Save lukelex/8609672 to your computer and use it in GitHub Desktop.
Save lukelex/8609672 to your computer and use it in GitHub Desktop.
Stik.js test setup experiments
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