From a quick scan through of the code of supertest and vague knowledge on how Cloud9 works, it appears that the code you showed forces the Express application to choose a random port (if the application isn't already listening) and listen.
This won't work with Cloud9 because as far as I know, the assigned listen addresses are loopback addresses and are proxied to your project page. Instead, use this code:
var request = require('supertest')
var express = require('express');
var app = express();
app.get('/user', function(req, res) {
res.send(201, { name: 'tobi' });
});
app.listen(process.env.PORT, process.env.IP);
This way, you assign a proper address and port to the Express application, and supertest won't assign a random port to it. Then use supertest like this:
request = request('http://' + process.env.IP + ':' + process.env.PORT);
request.get('/user')
.expect('Content-Type', /json/)
.expect('Content-Length', '20')
.expect(201)
.end(function(err, res) {
if (err) throw err;
});