numOnly.test.js 539 B

12345678910111213141516171819
  1. require("./chai.helper");
  2. var domHelper = require("./dom.helper");
  3. describe("numonly", function () {
  4. it("should remove characters from the string", function () {
  5. var tmp=window.numOnly("123asdf");
  6. tmp.should.equal(123);
  7. });
  8. it("should return a float",function(){
  9. var tmp=window.numOnly("3.14Pie");
  10. tmp.should.equal(3.14);
  11. });
  12. it("should remove characters from the front of the string",function(){
  13. var tmp=window.numOnly("pie3.14");
  14. tmp.should.equal(3.14);
  15. });
  16. });