Modify tests and fix NaN issue in chrome

This commit is contained in:
Kegan Myers 2014-03-03 15:08:37 -06:00
parent d87e5f41ea
commit ef8e1eeb9c
5 changed files with 36 additions and 31 deletions

View file

@ -7,7 +7,11 @@ module.exports = function (grunt) {
unit: { unit: {
configFile: "karma.conf.js", configFile: "karma.conf.js",
singleRun: true, singleRun: true,
browsers: ['PhantomJS'] browsers: ["PhantomJS", "Chrome"]
},
watch: {
configFile: "karma.conf.js",
browsers: ["PhantomJS", "Chrome"]
} }
}, },
typescript: { typescript: {

View file

@ -193,7 +193,7 @@ var Typertext;
if (typeof path === "undefined") { path = "/"; } if (typeof path === "undefined") { path = "/"; }
if (typeof queryString === "undefined") { queryString = {}; } if (typeof queryString === "undefined") { queryString = {}; }
if (typeof port === "undefined") { port = 0; } if (typeof port === "undefined") { port = 0; }
if (port < 1 || port > 65535) { if (port < 1 || port > 65535 || isNaN(port)) {
port = HttpUrl.DefaultPort(protocol); port = HttpUrl.DefaultPort(protocol);
} }

File diff suppressed because one or more lines are too long

View file

@ -141,7 +141,7 @@ module Typertext.Http {
* @constructor * @constructor
*/ */
constructor(domain:string, protocol:HttpProtocol = HttpProtocol.http, path:string = "/", queryString:HttpQueryString = {}, port:number = 0) { constructor(domain:string, protocol:HttpProtocol = HttpProtocol.http, path:string = "/", queryString:HttpQueryString = {}, port:number = 0) {
if (port < 1 || port > 65535) { if (port < 1 || port > 65535 || isNaN(port)) {
port = HttpUrl.DefaultPort(protocol); port = HttpUrl.DefaultPort(protocol);
} }

View file

@ -1,29 +1,30 @@
{ {
"name": "Typertext", "name": "Typertext",
"description": "A simple TypeScript HTTP request library", "description": "A simple TypeScript HTTP request library",
"repository": { "repository": {
"type": "git", "type": "git",
"url": "https://github.com/terribleplan/Typertext.git" "url": "https://github.com/terribleplan/Typertext.git"
}, },
"version": "0.3.1", "version": "0.3.1",
"devDependencies": { "devDependencies": {
"grunt": "~0.4.2", "grunt": "~0.4.2",
"grunt-typescript": "~0.2.7", "grunt-cli": "~0.1.13",
"karma-script-launcher": "~0.1.0", "grunt-typescript": "~0.2.7",
"karma-chrome-launcher": "~0.1.2", "karma-script-launcher": "~0.1.0",
"karma-firefox-launcher": "~0.1.3", "karma-chrome-launcher": "~0.1.2",
"karma-html2js-preprocessor": "~0.1.0", "karma-firefox-launcher": "~0.1.3",
"karma-jasmine": "~0.1.5", "karma-html2js-preprocessor": "~0.1.0",
"karma-coffee-preprocessor": "~0.1.3", "karma-jasmine": "~0.1.5",
"requirejs": "~2.1.11", "karma-coffee-preprocessor": "~0.1.3",
"karma-requirejs": "~0.2.1", "requirejs": "~2.1.11",
"karma-phantomjs-launcher": "~0.1.2", "karma-requirejs": "~0.2.1",
"karma": "~0.10.9", "karma-phantomjs-launcher": "~0.1.2",
"grunt-karma": "~0.6.2", "karma": "~0.10.9",
"phantomjs": "~1.9.7-1" "grunt-karma": "~0.6.2",
}, "phantomjs": "~1.9.7-1"
"license": "MIT", },
"scripts": { "license": "MIT",
"test": "./node_modules/.bin/karma start karma.conf.js --single-run" "scripts": {
} "test": "./node_modules/.bin/grunt test"
}
} }