Skip to content

Commit

Permalink
Recovered the test cases
Browse files Browse the repository at this point in the history
  • Loading branch information
iwillwen committed Mar 15, 2013
1 parent 2264448 commit d7e5b13
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 31 deletions.
6 changes: 6 additions & 0 deletions Makefile
@@ -0,0 +1,6 @@
REPORTER = spec

test:
@./node_modules/.bin/mocha -R spec --globals server,httpsServer

.PHONY: test
6 changes: 3 additions & 3 deletions package.json
Expand Up @@ -32,17 +32,17 @@
"dataStream": "latest",
"connect": "latest",
"mime": "latest",
"crc": "latest",
"mocha": ""
"crc": "latest"
},
"scripts": {
"test": "./node_module/.bin/mocha -R spec --globals server,httpsServer"
"test": "make test"
},
"bin": {
"webjs": "./bin/webjs"
},
"devDependencies": {
"mocha": "1.6.0",
"should": "*",
"mustache": "latest",
"jade": "latest"
},
Expand Down
31 changes: 3 additions & 28 deletions test/web.run.js
@@ -1,40 +1,15 @@
var web = require('../');
var assert = require("assert");

describe('web.run default', function () {
it('should start a http server on 80 port', function () {
var g = function (port, host) {
assert.equal(80, port);
web.removeListener('listening', g);
};

web.on('listening', g);
web.run();
});
});

describe('web.run port', function () {
/*describe('web.run', function () {
it('should start a http server on designated port', function () {
var port = Math.floor(Math.random() * 100);
var g = function (_port) {
var g = function (_port, _host) {
assert.equal(port, _port);
web.removeListener('listening', g);
};
web.on('listening', g);
web.run(port);
});
});

describe('web.run host', function () {
it('should start a http server on designated host', function () {
var port = Math.floor(Math.random() * 100);
var g = function (port, _host) {
assert.equal('localhost', _host);
web.removeListener('listening', g);
};

web.on('listening', g);
web.run(port, 'localhost');
});
});
});*/

0 comments on commit d7e5b13

Please sign in to comment.