Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/matomo-org/matomo.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'tests/lib/mocha-3.1.0/test/http-meta.spec.js')
-rw-r--r--tests/lib/mocha-3.1.0/test/http-meta.spec.js61
1 files changed, 0 insertions, 61 deletions
diff --git a/tests/lib/mocha-3.1.0/test/http-meta.spec.js b/tests/lib/mocha-3.1.0/test/http-meta.spec.js
deleted file mode 100644
index 5d1fb6750b..0000000000
--- a/tests/lib/mocha-3.1.0/test/http-meta.spec.js
+++ /dev/null
@@ -1,61 +0,0 @@
-var http = require('http');
-
-var PORT = 8889;
-
-var server = http.createServer(function(req, res){
- var accept = req.headers.accept || ''
- , json = ~accept.indexOf('json');
-
- switch (req.url) {
- case '/':
- res.end('hello');
- break;
- case '/users':
- if (json) {
- res.end('["tobi","loki","jane"]');
- } else {
- res.end('tobi, loki, jane');
- }
- break;
- }
-});
-
-
-function get(url, body, header) {
- return function(done){
- http.get({ path: url, port: PORT, headers: header || {}}, function(res){
- var buf = '';
- res.should.have.property('statusCode', 200);
- res.setEncoding('utf8');
- res.on('data', function(chunk){ buf += chunk });
- res.on('end', function(){
- buf.should.equal(body);
- done();
- });
- })
- }
-}
-
-describe('http requests', function () {
-
- before(function(done) {
- server.listen(PORT, done);
- });
-
- after(function() {
- server.close();
- });
-
- describe('GET /', function () {
- it('should respond with hello',
- get('/', 'hello'))
- })
-
- describe('GET /users', function(){
- it('should respond with users',
- get('/users', 'tobi, loki, jane'))
-
- it('should respond with users',
- get('/users', '["tobi","loki","jane"]', { Accept: 'application/json' }))
- })
-})