diff --git a/lib/6to5/util.js b/lib/6to5/util.js index afcfa15e20..c580240c83 100644 --- a/lib/6to5/util.js +++ b/lib/6to5/util.js @@ -58,12 +58,6 @@ exports.errorWithNode = function (node, msg) { return err; }; -exports.camelCase = function (value) { - return value.replace(/[-_\s]+(.)?/g, function (match, c) { - return c ? c.toUpperCase() : ""; - }); -}; - exports.canCompile = function (filename) { var ext = path.extname(filename); return _.contains([".js", ".es6", ".jsx"], ext); diff --git a/test/util.js b/test/util.js index fbdf9e0f2a..dd8ce5126c 100644 --- a/test/util.js +++ b/test/util.js @@ -14,7 +14,7 @@ suite("util", function () { }, /a get already exists for this property/); }); - test("can compile", function () { + test("canCompile", function () { assert.ok(util.canCompile("test.js")); assert.ok(util.canCompile("/test.js")); assert.ok(util.canCompile("/scripts/test.js")); @@ -28,4 +28,18 @@ suite("util", function () { assert.ok(!util.canCompile("/test.css")); assert.ok(!util.canCompile("/scripts/test.css")); }); + + test("isAbsolute", function () { + assert.ok(util.isAbsolute("/test.js")); + assert.ok(util.isAbsolute("C:\\test.js")); + + assert.ok(!util.isAbsolute("test.js")); + assert.ok(!util.isAbsolute("test/test.js")); + }); + + test("invalid template", function () { + assert.throws(function () { + util.template("invalid template"); + }, /unknown template/); + }); });