mirror of
https://github.com/pcottle/learnGitBranching.git
synced 2025-06-30 01:34:26 +02:00
before headless fix, but not animation factory is static class
This commit is contained in:
parent
a7e515dd8c
commit
d0e206bcc4
4 changed files with 56 additions and 49 deletions
|
@ -16,6 +16,16 @@ var Command = require('../models/commandModel').Command;
|
|||
var mock = require('../util/mock').mock;
|
||||
var util = require('../util');
|
||||
|
||||
function getMockFactory() {
|
||||
var mockFactory = {};
|
||||
for (var key in AnimationFactory) {
|
||||
mockFactory[key] = function() {
|
||||
return Q.defer().promise;
|
||||
};
|
||||
}
|
||||
return mockFactory;
|
||||
}
|
||||
|
||||
var HeadlessGit = function() {
|
||||
this.init();
|
||||
};
|
||||
|
@ -27,7 +37,7 @@ HeadlessGit.prototype.init = function() {
|
|||
|
||||
// here we mock visuals and animation factory so the git engine
|
||||
// is headless
|
||||
var animationFactory = mock(AnimationFactory);
|
||||
var animationFactory = getMockFactory();
|
||||
var gitVisuals = mock(GitVisuals);
|
||||
|
||||
this.gitEngine = new GitEngine({
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue