├── .gitignore~ ├── .gitignore ├── circle.yml ├── index.js ├── package.json └── test └── test.js /.gitignore~: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | node_modules 2 | -------------------------------------------------------------------------------- /circle.yml: -------------------------------------------------------------------------------- 1 | #circle.yml 2 | machine: 3 | node: 4 | version: 0.12.7 5 | 6 | test: 7 | override: 8 | - ./node_modules/.bin/mocha -------------------------------------------------------------------------------- /index.js: -------------------------------------------------------------------------------- 1 | var express = require('express'); 2 | var app = express(); 3 | 4 | app.get("/",function(req,res){ 5 | res.send("Hello Would!"); 6 | }); 7 | 8 | var server = app.listen(3000,function(){ 9 | var host = server.address().address; 10 | var port = server.address().port; 11 | 12 | console.log("Listen http://%s:%s",host,port); 13 | }); -------------------------------------------------------------------------------- /package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "hello-node", 3 | "version": "1.0.0", 4 | "description": "from hubs", 5 | "main": "index.js", 6 | "scripts": { 7 | "test": "echo \"Error: no test specified\" && exit 1", 8 | "start": "node index.js" 9 | }, 10 | "author": "", 11 | "license": "ISC", 12 | "dependencies": { 13 | "express": "^4.13.4" 14 | }, 15 | "devDependencies": { 16 | "mocha": "^2.5.3" 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /test/test.js: -------------------------------------------------------------------------------- 1 | var assert = require("assert"); 2 | describe('#indexOf',function(){ 3 | it('Shoud return -1 when the value is not present',function(){ 4 | assert.equal(-1,[1,2,3].indexOf(0)); 5 | }); 6 | 7 | it('Shoue return 0 when value is presend',function(){ 8 | assert.equal(0,[1,2,3].indexOf(1)); 9 | }); 10 | 11 | it('Shoud return 2',function(){ 12 | assert.equal(2,[1,2,3].indexOf(3)); 13 | }); 14 | 15 | it('Shoud return Error',function(){ 16 | assert.equal(-1,[1,2,3].indexOf(5)); 17 | }); 18 | }); 19 | 20 | 21 | --------------------------------------------------------------------------------