No description, website, or topics provided.
JavaScript
Switch branches/tags
Nothing to show
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
src
test
.gitignore
README.md
first-server.iml
package.json

README.md

first-server

Install Dependency

npm install mocha test/adder-test.js

Run index.js test

node src/index.js

Open another console, then

mocha test/index-test.js

Run index-square.js test

node src/index-square.js

Open another console, then

mocha test/index-square-test.js

mocha test/index-square-test-with-mock-http.js

Asynchronous Test

https://github.com/javascript-me/first-server/blob/master/test/indexTest.js

To DO

When the service is not up, there is an error when running test like this:

Error: connect ECONNREFUSED 127.0.0.1:3333
    at Object.exports._errnoException (util.js:907:11)
    at exports._exceptionWithHostPort (util.js:930:20)
    at TCPConnectWrap.afterConnect [as oncomplete] (net.js:1077:14)