I've got a project that I'd like to move the testing from rhino to nodejs for (rhino simply takes too long to start and load in envjs). This is the current blocker before being able to move forward:
ExampleSingleton = new function () {
var something = someFunction () {/*Does something*/}
$(window).bind('resize', something);
}();
This complains about window not being defined - I don't know how to get the 'window' that I made in the shell (#!/usr/bin/env node) script that I wrote (see below, and pardon the chaos, as I've gotten to that "try anything and everything" point).
var dom = require("jsdom").jsdom()
var window = global.window = dom.createWindow();
global.jQuery = require("jQuery");
global.$ = global.jQuery;
....
require("path/to/file"); //This is where it breaks, before the tests even start
I've tried reading in and eval'ing as well, but that didn't much help and of course the error was masked because it was an anonymous function.
Am I trying to do the impossible here? Or is there a very simple browser friendly thing I can do to get this working?