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
define([/* dependencies */], function(){ | |
nodeunit.run({ | |
"test my module": function (test) { | |
// run test | |
} | |
}); | |
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
<!DOCTYPE html> | |
<html> | |
<head> | |
<title>DOM-shim unit tests</title> | |
<link rel="stylesheet" href="resources/nodeunit.css" type="text/css" /> | |
<script src="resources/es5-shim.js"></script> | |
<script src="resources/nodeunit.js"></script> | |
<script src="../code/my/file"></script> | |
</head> | |
<body> |
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
define(['moduleA.js'], function(ModuleA){ | |
return { | |
"test1": function (test) { | |
// run test on ModuleA | |
}, | |
"test2": function (test) { | |
// run test on ModuleA | |
}, |
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
head | |
meta(charset="utf-8") | |
meta(http-equiv="X-UA-Compatible", content="IE=edge,chrome=1") | |
title= title | |
link(rel='stylesheet', href='/public/js/libs/qunit/qunit.css') | |
script(src="/public/js/libs/qunit/qunit.js") | |
script(data-main="/public/js/app-test", src="/public/js/libs/require/require.js") |
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
// module dependencies | |
var http = require('http'), | |
url = require('url'); | |
/** | |
* UrlReq - Wraps the http.request function making it nice for unit testing APIs. | |
* | |
* @param {string} reqUrl The required url in any form | |
* @param {object} options An options object (this is optional) |
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
// ROUTES | |
var Routes = Backbone.Router.extend({ | |
// Route Definitions | |
routes: { | |
'' : 'feed', | |
'feed' : 'feed', | |
'files' : 'files', | |
'members' : 'members', | |
':view/:itemID' : 'viewItem', |
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
// ROUTES | |
var Routes = Backbone.Router.extend({ | |
// Route Definitions | |
routes: { | |
'' : 'feed', | |
'feed' : 'feed', | |
'files' : 'files', | |
'members' : 'members', | |
':view/:itemID' : 'viewItem', |
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
define([ | |
'jQuery', | |
'Underscore', | |
'Backbone', | |
'modules/feed', | |
'modules/files', | |
'modules/members', | |
'modules/misc/GBL', | |
'modules/misc/lightbox' | |
], function($, _, Backbone, Feed, Files, Members, GBL, Lightbox){ |
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
/** | |
* 'UpdateDuplicateData' | |
* | |
* Used to update user data on all models that it is duplicated on | |
* | |
* @param {object} User The main user model | |
* @param {object} changes An object containing the changed user attributes | |
* @param {Function} cb Callback - function(err){} | |
* | |
*/ |
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
(function($){ | |
$.print_r = (function(){ | |
var depth = 0; | |
var render = function(o){ | |
var str='', | |
indent = (function(){ | |
var res=""; | |
for(var i=0; i<depth*4; i++){ res+=' ' }; | |
return res; |
OlderNewer