UNPKG

xml.js

Version:

XML.js provides helper functions for XML manipulation, including conversion of documents into [JXON](https://developer.mozilla.org/en-US/docs/JXON) objects. It is built on top of [xmldom](https://www.npmjs.org/package/xmldom) & [xpath](https://www.npmjs.o

24 lines (22 loc) 806 B
var expect = require("expect.js"); var Utility = require("../../source/Utility"); describe("Utility", function() { describe("#capitalize", function() { it("should work properly", function() { expect(Utility.capitalize("hello!")).to.be("Hello!"); expect(Utility.capitalize("HELLO!")).to.be("HELLO!"); }); }); describe("#isDefined", function() { it("should work properly", function() { expect(Utility.isDefined(undefined)).to.be(false); expect(Utility.isDefined({})).to.be(true); expect(Utility.isDefined([])).to.be(true); expect(Utility.isDefined(function() {})).to.be(true); expect(Utility.isDefined(1)).to.be(true); expect(Utility.isDefined(NaN)).to.be(true); expect(Utility.isDefined(null)).to.be(true); expect(Utility.isDefined(/^$/)).to.be(true); }); }); });