refactor template test

This commit is contained in:
Iuri Matias 2018-07-06 18:02:25 +03:00
parent a4b95d13d5
commit c5b10cce17
1 changed files with 18 additions and 24 deletions

View File

@ -12,46 +12,40 @@ describe('TemplateGenerator', function () {
describe('with github link', function () {
it('return correct zip filename for https link', function (done) {
it('return correct zip filename for https link', function () {
let result = templateGenerator.getExternalProject("https://github.com/embark-framework/embark");
assert.deepEqual(result.url, "https://github.com/embark-framework/embark/archive/master.zip");
assert.deepEqual(result.filePath, ".embark/templates/embark-framework/embark/archive.zip");
done();
assert.strictEqual(result.url, "https://github.com/embark-framework/embark/archive/master.zip");
assert.strictEqual(result.filePath, ".embark/templates/embark-framework/embark/archive.zip");
});
it('return correct zip filename for http link', function (done) {
it('return correct zip filename for http link', function () {
let result = templateGenerator.getExternalProject("http://github.com/embark-framework/embark");
assert.deepEqual(result.url, "http://github.com/embark-framework/embark/archive/master.zip");
assert.deepEqual(result.filePath, ".embark/templates/embark-framework/embark/archive.zip");
done();
assert.strictEqual(result.url, "http://github.com/embark-framework/embark/archive/master.zip");
assert.strictEqual(result.filePath, ".embark/templates/embark-framework/embark/archive.zip");
});
it('return correct zip filename without protocol specified ', function (done) {
it('return correct zip filename without protocol specified ', function () {
let result = templateGenerator.getExternalProject("github.com/embark-framework/embark");
assert.deepEqual(result.url, "https://github.com/embark-framework/embark/archive/master.zip");
assert.deepEqual(result.filePath, ".embark/templates/embark-framework/embark/archive.zip");
done();
assert.strictEqual(result.url, "https://github.com/embark-framework/embark/archive/master.zip");
assert.strictEqual(result.filePath, ".embark/templates/embark-framework/embark/archive.zip");
});
it('return correct zip filename without protocol specified ', function (done) {
it('return correct zip filename without protocol specified ', function () {
let result = templateGenerator.getExternalProject("github.com/embark-framework/embark");
assert.deepEqual(result.url, "https://github.com/embark-framework/embark/archive/master.zip");
assert.deepEqual(result.filePath, ".embark/templates/embark-framework/embark/archive.zip");
done();
assert.strictEqual(result.url, "https://github.com/embark-framework/embark/archive/master.zip");
assert.strictEqual(result.filePath, ".embark/templates/embark-framework/embark/archive.zip");
});
it('return correct zip filename with just username/repo specified', function (done) {
it('return correct zip filename with just username/repo specified', function () {
let result = templateGenerator.getExternalProject("embark-framework/embark");
assert.deepEqual(result.url, "https://github.com/embark-framework/embark/archive/master.zip");
assert.deepEqual(result.filePath, ".embark/templates/embark-framework/embark/archive.zip");
done();
assert.strictEqual(result.url, "https://github.com/embark-framework/embark/archive/master.zip");
assert.strictEqual(result.filePath, ".embark/templates/embark-framework/embark/archive.zip");
});
it('return correct zip filename with just embark template specified', function (done) {
it('return correct zip filename with just embark template specified', function () {
let result = templateGenerator.getExternalProject("react");
assert.deepEqual(result.url, "https://github.com/embark-framework/embark-react-template/archive/master.zip");
assert.deepEqual(result.filePath, ".embark/templates/embark-framework/embark-react-template/archive.zip");
done();
assert.strictEqual(result.url, "https://github.com/embark-framework/embark-react-template/archive/master.zip");
assert.strictEqual(result.filePath, ".embark/templates/embark-framework/embark-react-template/archive.zip");
});
});