Comparing version 0.1.1 to 0.1.2
@@ -14,3 +14,3 @@ var fs = require("fs"); | ||
data.type = 'svn'; | ||
data.url = stdout.match(/Repository Root:([^\n]+)/); | ||
data.url = stdout.match(/Repository Root: ([^\n]+)/); | ||
if (data.url) data.url = data.url[1]; | ||
@@ -17,0 +17,0 @@ data.branch = data.url.match(/[^/]+$/); |
{ | ||
"name": "vizion", | ||
"version": "0.1.1", | ||
"version": "0.1.2", | ||
"engines": { | ||
@@ -5,0 +5,0 @@ "node": ">=0.10" |
var assert = require("assert"); | ||
var shell = require("shelljs"); | ||
var vizion = require(".."); | ||
@@ -16,3 +17,3 @@ | ||
svn: { | ||
directory: "test/fixtures/test_svn/", | ||
directory: "./test/fixtures/test_svn/", | ||
url: "https://github.com/jshkurti/vizionar_test", | ||
@@ -25,3 +26,3 @@ revision: "r3", | ||
hg: { | ||
directory: "test/fixtures/test_hg/", | ||
directory: "./test/fixtures/test_hg/", | ||
url: "https://jshkurti@bitbucket.org/jshkurti/vizionar_test", | ||
@@ -36,28 +37,28 @@ revision: "0:a070c08854c3", | ||
describe("vizion.analyze()", function() { | ||
it.skip("Pulling from Subversion", function(done) { | ||
this.timeout(5000); | ||
vizion.analyze({folder: sample.svn.directory}, function(err, metadata) { | ||
assert.equal(err, null); | ||
assert.equal(metadata.url, sample.svn.url); | ||
assert.equal(metadata.revision, sample.svn.revision); | ||
assert.equal(metadata.comment, sample.svn.comment); | ||
assert.equal(metadata.branch, sample.svn.branch); | ||
//assert.equal(""+metadata.update_time, sample.svn.update_time); | ||
done(); | ||
}); | ||
}); | ||
it.skip("Pulling from Mercurial", function(done) { | ||
this.timeout(5000); | ||
vizion.analyze({folder: sample.hg.directory}, function(err, metadata) { | ||
assert.equal(err, null); | ||
assert.equal(metadata.url, sample.hg.url); | ||
assert.equal(metadata.revision, sample.hg.revision); | ||
assert.equal(metadata.comment, sample.hg.comment); | ||
assert.equal(metadata.branch, sample.hg.branch); | ||
//assert.equal(""+metadata.update_time, sample.hg.update_time); | ||
done(); | ||
}); | ||
}); | ||
if (shell.which('svn')) { | ||
it.skip("Pulling from Subversion", function(done) { | ||
this.timeout(5000); | ||
vizion.analyze({folder: sample.svn.directory}, function(err, metadata) { | ||
assert.equal(err, null); | ||
assert.equal(metadata.url, sample.svn.url); | ||
assert.equal(metadata.revision, sample.svn.revision); | ||
assert.equal(metadata.comment, sample.svn.comment); | ||
assert.equal(metadata.branch, sample.svn.branch); | ||
done(); | ||
}); | ||
}); | ||
} | ||
if (shell.which('hg')) { | ||
it("Pulling from Mercurial", function(done) { | ||
this.timeout(5000); | ||
vizion.analyze({folder: sample.hg.directory}, function(err, metadata) { | ||
assert.equal(err, null); | ||
assert.equal(metadata.url, sample.hg.url); | ||
assert.equal(metadata.revision, sample.hg.revision); | ||
assert.equal(metadata.comment, sample.hg.comment); | ||
assert.equal(metadata.branch, sample.hg.branch); | ||
done(); | ||
}); | ||
}); | ||
} | ||
}); |
@@ -7,138 +7,139 @@ | ||
describe('Git scenario', function() { | ||
var repo_pwd = ''; | ||
var tmp_meta = {}; | ||
if (shell.which('git') !== null) { | ||
describe('Git scenario', function() { | ||
var repo_pwd = ''; | ||
var tmp_meta = {}; | ||
before(function(done) { | ||
this.timeout(10000); | ||
shell.cd('test/fixtures'); | ||
before(function(done) { | ||
this.timeout(10000); | ||
shell.cd('test/fixtures'); | ||
if (shell.ls('angular-bridge').length == 0) | ||
shell.exec('git clone https://github.com/Unitech/angular-bridge.git'); | ||
if (shell.ls('angular-bridge').length == 0) | ||
shell.exec('git clone https://github.com/Unitech/angular-bridge.git'); | ||
repo_pwd = p.join(shell.pwd(), 'angular-bridge'); | ||
repo_pwd = p.join(shell.pwd(), 'angular-bridge'); | ||
done(); | ||
}); | ||
done(); | ||
}); | ||
after(function(done) { | ||
//shell.rm('-rf', 'angular-bridge'); | ||
done(); | ||
}); | ||
it('should update to latest', function(done) { | ||
this.timeout(10000); | ||
vizion.update({ | ||
folder : repo_pwd | ||
}, function(err, meta) { | ||
should(err).not.exist; | ||
should(meta.success).be.true; | ||
after(function(done) { | ||
//shell.rm('-rf', 'angular-bridge'); | ||
done(); | ||
}); | ||
}); | ||
it('should analyze versioned folder', function(done) { | ||
this.timeout(10000); | ||
vizion.analyze({ | ||
folder: repo_pwd | ||
}, function(err, meta) { | ||
should(err).not.exist; | ||
it('should update to latest', function(done) { | ||
this.timeout(10000); | ||
vizion.update({ | ||
folder : repo_pwd | ||
}, function(err, meta) { | ||
should(err).not.exist; | ||
should(meta.success).be.true; | ||
done(); | ||
}); | ||
}); | ||
meta.type.should.equal('git'); | ||
meta.branch.should.equal('master'); | ||
should.exist(meta.comment); | ||
should.exist(meta.url); | ||
should.exist(meta.revision); | ||
it('should analyze versioned folder', function(done) { | ||
this.timeout(10000); | ||
vizion.analyze({ | ||
folder: repo_pwd | ||
}, function(err, meta) { | ||
should(err).not.exist; | ||
should(meta.next_rev).be.null; | ||
should(meta.prev_rev).not.be.null; | ||
meta.type.should.equal('git'); | ||
meta.branch.should.equal('master'); | ||
should.exist(meta.comment); | ||
should.exist(meta.url); | ||
should.exist(meta.revision); | ||
tmp_meta = meta; | ||
should(meta.next_rev).be.null; | ||
should(meta.prev_rev).not.be.null; | ||
done(); | ||
tmp_meta = meta; | ||
done(); | ||
}); | ||
}); | ||
}); | ||
it('should checkout older version', function(done) { | ||
this.timeout(10000); | ||
vizion.revertTo({ | ||
folder : repo_pwd, | ||
revision : tmp_meta.prev_rev | ||
}, function(err, meta) { | ||
should(err).not.exist; | ||
it('should checkout older version', function(done) { | ||
this.timeout(10000); | ||
vizion.revertTo({ | ||
folder : repo_pwd, | ||
revision : tmp_meta.prev_rev | ||
}, function(err, meta) { | ||
should(err).not.exist; | ||
done(); | ||
done(); | ||
}); | ||
}); | ||
}); | ||
it('should has next and prev', function(done) { | ||
this.timeout(10000); | ||
vizion.analyze({ | ||
folder: repo_pwd | ||
}, function(err, meta) { | ||
should(err).not.exist; | ||
it('should has next and prev', function(done) { | ||
this.timeout(10000); | ||
vizion.analyze({ | ||
folder: repo_pwd | ||
}, function(err, meta) { | ||
should(err).not.exist; | ||
should(meta.next_rev).not.be.null; | ||
should(meta.prev_rev).not.be.null; | ||
should(meta.next_rev).not.be.null; | ||
should(meta.prev_rev).not.be.null; | ||
tmp_meta = meta; | ||
tmp_meta = meta; | ||
done(); | ||
done(); | ||
}); | ||
}); | ||
}); | ||
it('should see that its not on HEAD', function(done) { | ||
this.timeout(10000); | ||
it('should see that its not on HEAD', function(done) { | ||
this.timeout(10000); | ||
vizion.isUpToDate({ | ||
folder : repo_pwd | ||
}, function(err, meta) { | ||
vizion.isUpToDate({ | ||
folder : repo_pwd | ||
}, function(err, meta) { | ||
should(err).not.exist; | ||
meta.is_up_to_date.should.be.false; | ||
should(err).not.exist; | ||
meta.is_up_to_date.should.be.false; | ||
done(); | ||
done(); | ||
}); | ||
}); | ||
}); | ||
it('should recursively downgrade to first commit', function(done) { | ||
this.timeout(20000); | ||
var callback = function(err, meta) { | ||
should(err).not.exist; | ||
should(meta).be.ok; | ||
if (meta.success === true) { | ||
vizion.prev({folder: repo_pwd}, callback); | ||
it('should recursively downgrade to first commit', function(done) { | ||
this.timeout(20000); | ||
var callback = function(err, meta) { | ||
should(err).not.exist; | ||
should(meta).be.ok; | ||
if (meta.success === true) { | ||
vizion.prev({folder: repo_pwd}, callback); | ||
} | ||
else { | ||
should(meta.success).be.false; | ||
vizion.analyze({folder: repo_pwd}, function(err, meta) { | ||
should(err).not.exist; | ||
should(meta.prev_rev).be.null; | ||
done(); | ||
}); | ||
} | ||
} | ||
else { | ||
should(meta.success).be.false; | ||
vizion.analyze({folder: repo_pwd}, function(err, meta) { | ||
should(err).not.exist; | ||
should(meta.prev_rev).be.null; | ||
done(); | ||
}); | ||
vizion.prev({folder : repo_pwd}, callback); | ||
}); | ||
it('should recursively upgrade to most recent commit', function(done) { | ||
this.timeout(20000); | ||
var callback = function(err, meta) { | ||
should(err).not.exist; | ||
should(meta).be.ok; | ||
if (meta.success === true) { | ||
vizion.next({folder: repo_pwd}, callback); | ||
} | ||
else { | ||
should(meta.success).be.false; | ||
vizion.analyze({folder: repo_pwd}, function(err, meta) { | ||
should(err).not.exist; | ||
should(meta.next_rev).be.null; | ||
done(); | ||
}); | ||
} | ||
} | ||
} | ||
vizion.prev({folder : repo_pwd}, callback); | ||
}); | ||
vizion.next({folder : repo_pwd}, callback); | ||
}); | ||
it('should recursively upgrade to most recent commit', function(done) { | ||
this.timeout(20000); | ||
var callback = function(err, meta) { | ||
should(err).not.exist; | ||
should(meta).be.ok; | ||
if (meta.success === true) { | ||
vizion.next({folder: repo_pwd}, callback); | ||
} | ||
else { | ||
should(meta.success).be.false; | ||
vizion.analyze({folder: repo_pwd}, function(err, meta) { | ||
should(err).not.exist; | ||
should(meta.next_rev).be.null; | ||
done(); | ||
}); | ||
} | ||
} | ||
vizion.next({folder : repo_pwd}, callback); | ||
}); | ||
}); | ||
} |
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
60166
19
647