Skip to content

Commit

Permalink
#47 extending failure tests and fix functionality
Browse files Browse the repository at this point in the history
  • Loading branch information
kecso committed Apr 10, 2015
1 parent b885d2b commit de77bc4
Show file tree
Hide file tree
Showing 2 changed files with 37 additions and 0 deletions.
1 change: 1 addition & 0 deletions src/server/worker/simpleworker.js
Original file line number Diff line number Diff line change
Expand Up @@ -577,6 +577,7 @@ var getSeedFromFile = function (name) {
return JSON.parse(FS.readFileSync(gmeConfig.seedProjects.basePaths[i] + '/' + name + '.json', 'utf8'));
}
}
return null;
} catch (e) {
return null;
}
Expand Down
36 changes: 36 additions & 0 deletions test-karma/client/js/client.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -3250,6 +3250,7 @@ describe('GME client', function () {
});

it('should return a url where the given library (sub-tree) is available', function (done) {
this.timeout(5000);
client.getExportLibraryUrlAsync('', 'output', function (err, url) {
expect(err).to.equal(null);
expect(url).to.contain('output');
Expand Down Expand Up @@ -3603,6 +3604,7 @@ describe('GME client', function () {
});

it('should seed a project from a seed file', function (done) {
this.timeout(5000);
var projectName = 'seedTestBasicFile',
seedConfig = {
type: 'file',
Expand Down Expand Up @@ -3681,6 +3683,40 @@ describe('GME client', function () {
done();
});
});

it('should fail to seed form an unknown branch', function (done) {
var projectName = 'noBranchSeedProject',
seedConfig = {
seedName: 'projectSeedSingleMaster',
projectName: projectName,
seedBranch: 'unknownBranch'
};

client.seedProjectAsync(seedConfig, function (err) {
expect(err).not.to.equal(null);

expect(err).to.contain('unknownBranch');

done();
});
});

it('should fail to seed from an unknown seed file', function (done) {
var projectName = 'noSeedFileProject',
seedConfig = {
type: 'file',
seedName: 'UnknownSeedFile',
projectName: projectName
};

client.seedProjectAsync(seedConfig, function (err) {
expect(err).not.to.equal(null);

expect(err).to.contain('unknown file seed');

done();
});
});
});
})
;

0 comments on commit de77bc4

Please sign in to comment.