mirror of https://github.com/embarklabs/embark.git
update tests
This commit is contained in:
parent
81e798c89c
commit
b995aac813
|
@ -1,6 +1,7 @@
|
||||||
/*globals describe, it*/
|
/*globals describe, it*/
|
||||||
const assert = require('assert');
|
const assert = require('assert');
|
||||||
const TemplateGenerator = require('../lib/utils/template_generator');
|
const TemplateGenerator = require('../lib/utils/template_generator');
|
||||||
|
const semver = require('semver');
|
||||||
|
|
||||||
describe('TemplateGenerator', function () {
|
describe('TemplateGenerator', function () {
|
||||||
describe('getExternalProject', function () {
|
describe('getExternalProject', function () {
|
||||||
|
@ -14,9 +15,11 @@ describe('TemplateGenerator', function () {
|
||||||
|
|
||||||
it('returns correct info for named template', function () {
|
it('returns correct info for named template', function () {
|
||||||
let result = templateGenerator.getExternalProject("typescript");
|
let result = templateGenerator.getExternalProject("typescript");
|
||||||
assert.strictEqual(result.url, "https://codeload.github.com/embark-framework/embark-typescript-template/tar.gz/master");
|
let embarkVersion = semver(require('../package.json').version);
|
||||||
assert.strictEqual(result.filePath.replace(/\\/g,'/'), ".embark/templates/embark-framework/embark-typescript-template/master/archive.zip");
|
let branch = `${embarkVersion.major}.${embarkVersion.minor}`;
|
||||||
assert.strictEqual(result.browse, "https://github.com/embark-framework/embark-typescript-template");
|
assert.strictEqual(result.url, `https://codeload.github.com/embark-framework/embark-typescript-template/tar.gz/${branch}`);
|
||||||
|
assert.strictEqual(result.filePath.replace(/\\/g,'/'), `.embark/templates/embark-framework/embark-typescript-template/${branch}/archive.zip`);
|
||||||
|
assert.strictEqual(result.browse, `https://github.com/embark-framework/embark-typescript-template/tree/${branch}`);
|
||||||
|
|
||||||
result = templateGenerator.getExternalProject("typescript#features/branch");
|
result = templateGenerator.getExternalProject("typescript#features/branch");
|
||||||
assert.strictEqual(result.url, "https://codeload.github.com/embark-framework/embark-typescript-template/tar.gz/features%2Fbranch");
|
assert.strictEqual(result.url, "https://codeload.github.com/embark-framework/embark-typescript-template/tar.gz/features%2Fbranch");
|
||||||
|
|
Loading…
Reference in New Issue