{
"karma-mocha": "^0.2.1",
"karma-chai": "^0.1.0",
"karma-chai-as-promised": "^0.1.2",
"karma-sinon": "^1.0.4",
This file contains 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
/** | |
* iOS 6 style switch checkboxes | |
* by Lea Verou http://lea.verou.me | |
*/ | |
:root input[type="checkbox"] { /* :root here acting as a filter for older browsers */ | |
position: absolute; | |
opacity: 0; | |
} |
This file contains 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
/** | |
* http://stackoverflow.com/questions/4323411/how-can-i-write-to-console-in-php#answer-37218530 | |
* Simple helper to debug to the console | |
* | |
* @param $data object, array, string $data | |
* @param $context string Optional a description. | |
* | |
* @return string | |
*/ | |
function debug_to_console( $data, $context = 'Debug in Console' ) { |
This file contains 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
// Source: https://stackoverflow.com/questions/7837456/how-to-compare-arrays-in-javascript | |
// Warn if overriding existing method | |
if(Array.prototype.equals) | |
console.warn("Overriding existing Array.prototype.equals. Possible causes: New API defines the method, there's a framework conflict or you've got double inclusions in your code."); | |
// attach the .equals method to Array's prototype to call it on any array | |
Array.prototype.equals = function (array) { | |
// if the other array is a falsy value, return | |
if (!array) | |
return false; |
This file contains 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
const findSumIndex = require('./task_1'); | |
describe('findSumIndex', () => { | |
it('should return -1 | Input [1,2,3]', () => { | |
expect(findSumIndex([1,2,3])).toBe(-1); | |
}); | |
it('should return 0 | Input [1]', () => { | |
expect(findSumIndex([1])).toBe(0); | |
}); | |
This file contains 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 = { | |
trailingComma: "es5", | |
semi: true, | |
singleQuote: true, | |
useTabs: true, | |
printWidth: 120 | |
}; |