Skip to content

Instantly share code, notes, and snippets.

@todoubled
Created March 1, 2012 21:41
Show Gist options
  • Star 3 You must be signed in to star a gist
  • Fork 2 You must be signed in to fork a gist
  • Save todoubled/1953429 to your computer and use it in GitHub Desktop.
Save todoubled/1953429 to your computer and use it in GitHub Desktop.
JSDOM/jasmine
window = {} unless window?
global.$=require('jquery') unless jQuery?
global._=require('underscore') unless _?
global.Backbone=require('backbone') unless Backbone?
global.Mustache=require('../lib/mustache') unless Mustache?
global.localStorage=require('localStorage') unless localStorage?
global.Store=require('../lib/backbone.localStorage') unless Store?
global.jsdom = require("jsdom").jsdom
global.document = jsdom('<html><body></body></html>')
global.window = document.createWindow()
global.navigator =
browser: 'foo'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment