Browse Source

add functional test suite

pull/2/head
Peter Johnson 10 years ago
parent
commit
19e7be7422
  1. 4
      package.json
  2. 11
      test/ciao.json
  3. 17
      test/ciao/index.coffee

4
package.json

@ -8,7 +8,8 @@
"main": "index.js",
"scripts": {
"start": "node index.js",
"test": "echo \"Error: no test specified\" && exit 0"
"test": "echo \"Error: no test specified\" && exit 0",
"ciao": "node node_modules/ciao/bin/ciao -c test/ciao.json test/ciao"
},
"repository": {
"type": "git",
@ -28,6 +29,7 @@
"elasticsearch": ">=1.2.1"
},
"dependencies": {
"ciao": "^0.3.4",
"express": "^4.8.8"
}
}

11
test/ciao.json

@ -0,0 +1,11 @@
{
"defaults": {
"protocol": "http",
"host": "localhost",
"port": 3100,
"headers": {
"User-Agent": "Ciao/Client 1.0"
}
},
"config": {}
}

17
test/ciao/index.coffee

@ -0,0 +1,17 @@
#> api root
path: '/'
#? endpoint available
response.statusCode.should.equal 200
#? content-type header correctly set
response.should.have.header 'Content-Type','application/json; charset=utf-8'
#? cache-control header correctly set
response.should.have.header 'Cache-Control','public,max-age=60'
#? should respond in json with server info
should.exist json
should.exist json.name
should.exist json.version
Loading…
Cancel
Save