kopia lustrzana https://github.com/c9/core
add unit test
rodzic
b6c0d9fd06
commit
06bc14b9af
|
@ -0,0 +1,25 @@
|
|||
/*global describe it before after beforeEach afterEach define*/
|
||||
"use strict";
|
||||
"use server";
|
||||
"use mocha";
|
||||
|
||||
require("c9/inline-mocha")(module);
|
||||
|
||||
var assert = require("assert-diff");
|
||||
var hostname = require("./hostname");
|
||||
|
||||
describe(__filename, function() {
|
||||
|
||||
function assertServerName(sn, type, region, index, env) {
|
||||
assert.equal(sn.type, type);
|
||||
assert.equal(sn.region, region);
|
||||
assert.equal(sn.index, index);
|
||||
assert.equal(sn.env, env);
|
||||
}
|
||||
|
||||
it("parse hostname", function() {
|
||||
assertServerName(hostname.parse("fabian-gce-eu-04-dev"), "fabian", "eu", "04", "dev");
|
||||
assertServerName(hostname.parse("newclient-gce-eu-prod-d4fg"), "newclient", "eu", "d4fg", "prod");
|
||||
assertServerName(hostname.parse("ide-old-gce-usw-02-prod"), "ide-old", "usw", "02", "prod");
|
||||
});
|
||||
});
|
Ładowanie…
Reference in New Issue