Skip to content

Instantly share code, notes, and snippets.

@avishaan
avishaan / jasmineMultiTestOneSpecAsync.js
Created October 30, 2014 05:47
Jasmine test multiple values with one spec asyncly
describe("A calculator", function() {
it("should square correctly", function(done) {
[
{ number: 2, answer: 4},
{ number: 3, answer: 9},
{ number: 4, answer: 16}
].forEach(function(problem, index, array){
// we will pretend to calculate with our fnc here
setTimeout(function(){
var calcAnswer = problem.number*problem.number;
@avishaan
avishaan / jasmineMultiTestOneSpec.js
Created October 30, 2014 05:42
Jasmine test multi values with same 'it' spec
describe("A calculator", function() {
it("should square correctly", function() {
[
{ number: 2, answer: 4},
{ number: 3, answer: 9},
{ number: 4, answer: 16}
].forEach(function(problem, index, array){
// we will pretend to calculate with our fnc here
var calcAnswer = problem.number*problem.number;
expect(calcAnswer).toEqual(problem.answer);
@avishaan
avishaan / .bash_profile
Created September 11, 2014 20:42
Change iTerm color from command line
# a couple alias to switch iterm window from dark to light
alias itermlight='echo -e "\033]50;SetProfile=light\a"'
alias itermdark='echo -e "\033]50;SetProfile=dark\a"'