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
var mantri = require('mantri'); | |
var mantriCompile = require('mantri/lib/mantri-build-compile'); | |
mantriCompile.getDepsFiles({ | |
jsRoot: './js', | |
src: './js/app.js', | |
gmockDir: mantri.helpers.getPath('closure-mock'), | |
}, function(status, results) { | |
console.log('Status should be true:', status); |
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
test('test case', function(done) { | |
promise.method(function(result) { | |
assert.equal(result.name, 'mocha'); | |
}).then(done, done); | |
}); |
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
var apitest = module.exports = {}; | |
/** | |
* Have a Cooldown period between tests. | |
* | |
* @param {number} seconds cooldown in seconds. | |
* @return {Function} use is beforeEach(). | |
*/ | |
apitest.cooldown = function(seconds) { | |
return function(done) { |
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.exports = function (grunt) { | |
require('load-grunt-tasks')(grunt); | |
grunt.initConfig({ | |
express: { | |
options: { | |
// Override defaults here | |
}, | |
web: { | |
options: { |
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 retProm() { | |
var def = when.defer(); | |
return def.resolve(); | |
} | |
console.log('one'); | |
retProm().then(function(){console.log('two')); | |
console.log('three'); |
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.exports = function (grunt) { | |
grunt.initConfig({ | |
watch: { | |
options: { | |
livereload: true | |
}, | |
// triggering livereload when the .css file is updated | |
// (compared to triggering when sass completes) | |
// allows livereload to not do a full page refresh | |
styles: { |
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
//var PerfTime = require('perf-time'); | |
//var _ = require('underscore'); | |
var Perf = module.exports = function() { | |
this.startTime = null; | |
// this.t = new PerfTime(); | |
this.t = { | |
get: function() { | |
return Date.now(); | |
} |
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
var assert = require('chai').assert; | |
var when = require('when'); | |
var def1 = when.defer(); | |
function getProm() { | |
return def1.promise; | |
} |
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
// calling multiple callbacks for a promise | |
var promise = fnReturnsPromise(); | |
promise.then(fn1); | |
promise.then(fn2); | |
// that is not the same ? | |
fnReturnsPromise().then(fn1).then(fn2); | |
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.exports = function (grunt) { | |
multiTask: { | |
options: { | |
anObject: { | |
a: 1 | |
} | |
}, | |
target: { | |
options: { | |
anObject: { |