Skip to content

Instantly share code, notes, and snippets.

@xenophy
Created December 19, 2011 12:12
Show Gist options
  • Save xenophy/1496945 to your computer and use it in GitHub Desktop.
Save xenophy/1496945 to your computer and use it in GitHub Desktop.
SPEC Code Plan1 | Vergina - JavaScript unit and integration testing framework
spec('ExtJS', [
function(t) {
t.diag("case1");
t.ok('Ext', 'ExtJS is here');
t.ok('Ext.Window', '.. indeed');
t.ok('Your.Project', 'My project is here');
t.ok('Your.Project.Util', '.. indeed');
t.end();
},
function(t) {
t.exec([
// {{{ STEP1
"Ext.create('My.app.App', {",
"});"
// }}}
].join('')).
next(function(window, Vergina) {
// {{{ STEP2
t.exec([
"Ext.Ajax.request({",
" url : 'sample.json',",
" success : function (response, opts) {",
" Vergina('ret1', 'success')",
" },",
" failure : function (response, opts) {",
" Vergina('ret1', 'request failed');",
" }",
"});"
].join('')).
// }}}
next(function(window, Vergina) {
// {{{ STEP3
t.end();
// }}}
});
});
}
]);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment