Trying to be able to test in node GAHHHH

This commit is contained in:
Peter Cottle 2012-12-16 20:23:42 -08:00
parent c9fb851ad6
commit aadeab8299
14 changed files with 4186 additions and 69 deletions

View file

@ -1,7 +1,11 @@
if (!require('../util').isBrowser()) {
var _ = require('underscore');
var Backbone = require('backbone');
}
var Commit = require('../git').Commit;
var Branch = require('../git').Branch;
var Main = require('../app');
var Command = require('../models/commandModel').Command;
var CommandEntry = require('../models/commandModel').CommandEntry;
var TIME = require('../util/constants').TIME;
@ -20,7 +24,7 @@ var BranchCollection = Backbone.Collection.extend({
var CommandEntryCollection = Backbone.Collection.extend({
model: CommandEntry,
localStorage: new Backbone.LocalStorage('CommandEntries')
localStorage: (Backbone.LocalStorage) ? new Backbone.LocalStorage('CommandEntries') : null
});
var CommandBuffer = Backbone.Model.extend({
@ -74,6 +78,7 @@ var CommandBuffer = Backbone.Model.extend({
}
if (!popped.get('error')) {
// pass in a callback, so when this command is "done" we will process the next.
var Main = require('../app');
Main.getEvents().trigger('processCommand', popped, callback);
} else {
this.clear();