Skip to content

Instantly share code, notes, and snippets.

Avatar

Santiago Rojo tiagox

View GitHub Profile
@traviskaufman
traviskaufman / jasmine-this-vars.md
Last active Jul 19, 2021
Better Jasmine Tests With `this`
View jasmine-this-vars.md

Better Jasmine Tests With this

On the Refinery29 Mobile Web Team, codenamed "Bicycle", all of our unit tests are written using Jasmine, an awesome BDD library written by Pivotal Labs. We recently switched how we set up data for tests from declaring and assigning to closures, to assigning properties to each test case's this object, and we've seen some awesome benefits from doing such.

The old way

Up until recently, a typical unit test for us looked something like this:

describe('views.Card', function() {
View repos.txt
Iceweasel
deb http://mozilla.debian.net/ wheezy-backports iceweasel-release
Redis
deb http://packages.dotdeb.org wheezy all
@willurd
willurd / web-servers.md
Last active Dec 3, 2021
Big list of http static server one-liners
View web-servers.md

Each of these commands will run an ad hoc http static server in your current (or specified) directory, available at http://localhost:8000. Use this power wisely.

Discussion on reddit.

Python 2.x

$ python -m SimpleHTTPServer 8000