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
it('"moveRight()" should increment the "x" propety by 1', function () { | |
var blocky = new Block(15, 30); | |
blocky.moveRight(); | |
assert.equal(blocky.x, 16); | |
}); | |
//....vs.... | |
it('"moveRight()" should increment the "x" propety by 1', function () { | |
var startingX = 15; |
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
describe('Something', function() { | |
var values = ['a', 'b', 'c']; | |
values.forEach(function(val) { | |
it('should do something with ' + val + ' in this test', function() { | |
assert.equal(foo(), val); | |
}); | |
}) | |
}); |
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
describe('something', function() { | |
var oldXrm; | |
beforeEach(function() { | |
oldXrm = Xrm; | |
Xrm = { | |
Page: { | |
getAttribute: sinon.stub() | |
} | |
}; |
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
describe('something', function() { | |
var sandbox; | |
beforeEach(function() { | |
sandbox = sinon.sandbox.create(); | |
}); | |
afterEach(function() { | |
sandbox.restore(); | |
}); | |
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
var assert = require('assert'); | |
var Vue = require('vue'); | |
var TestComponent = Vue.extend({ | |
data: function() { | |
return { | |
active: 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
require 'spec_helper' | |
feature 'foo', :js => true do | |
it "hi" do | |
visit "/login" | |
# this screenshot exposes the issue in this case | |
save_screenshot('foo.jpg') | |
end | |
end |
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
var oldAddEventListener = window.addEventlistener; | |
var handlers = []; | |
window.addEventListener = function(event, handler, useCapture) { | |
handlers.push({ event: event, handler: handler }); | |
oldAddEventListener.call(window, event, handler, useCapture); | |
}; |
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
var Slack = require('slack-client'); | |
var vm = require('vm'); | |
var s = new Slack('api key here', true, true); | |
s.on('message', function(msg) { | |
if(msg.type != 'message') { | |
return; | |
} |
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
{-# LANGUAGE NoImplicitPrelude #-} | |
module Test where | |
import Language.Fay.Prelude | |
import Language.Fay.FFI | |
data Server = Server | |
{ name :: String | |
, age :: String | |
, popstate :: String |
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
{-# LANGUAGE BangPatterns #-} | |
import qualified Data.ByteString as B | |
import qualified Data.ByteString.Lazy as L | |
import Data.PEM (PEM(..), pemParseBS) | |
import Data.Certificate.X509 | |
import Data.Either | |
main :: IO () | |
main = do | |
certdata <- B.readFile "7d0b38bd.0" |