Created
April 24, 2015 20:54
-
-
Save nobleach/c928ceed50533c04ec61 to your computer and use it in GitHub Desktop.
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
'use strict'; | |
global.nodeMocha = true; | |
var chai = require('chai'); | |
var sinon = require('sinon'); | |
var sinonChai = require('sinon-chai'); | |
var chaiJq = require('chai-jq'); | |
chai.use(sinonChai); | |
chai.use(chaiJq); | |
global.expect = chai.expect; | |
global.sinon = sinon; | |
if (!global.document || !global.window) { | |
var jsdom = require('jsdom').jsdom; | |
global.document = jsdom('<html><head><script></script></head><body><div id="fixtures"></div></body></html>', null, { | |
FetchExternalResources: ['script'], | |
ProcessExternalResources: ['script'], | |
MutationEvents: '2.0', | |
QuerySelector: false | |
}); | |
global.window = document.parentWindow; | |
global.window.localStorage = require('localStorage'); | |
global.navigator = global.window.navigator; | |
global.window.Node.prototype.contains = function(node) { | |
/*jslint bitwise: true */ | |
return this.compareDocumentPosition(node) & 16; | |
}; | |
} | |
global.$ = global.jQuery = require('jquery'); | |
global._ = require('underscore'); | |
global.Backbone = require('backbone'); | |
global.Backbone.$ = global.$; | |
global.Backbone.Wreqr = require('backbone.wreqr'); | |
global.Handlebars = require('handlebars'); | |
global.Handlebars.templates = require('../../tmp/templates').Handlebars.templates; | |
require('backbone.babysitter'); | |
require('../../tmp/backbone.marionette'); | |
global.Marionette = Backbone.Marionette; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment