Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP

Loading…

TypeError: Object #<Object> has no method 'listen' #37

Open
codesplicer opened this Issue · 4 comments

4 participants

@codesplicer

Keep getting this error when running the following code against my expressjs app:

var app     = require('../app'),
    assert  = require('assert'),
    tobi    = require('tobi'),
    vows    = require('vows'),
    browser = tobi.createBrowser(app);

browser.get('/login', function(res, $){
});

Not sure what's causing this behavior.

@tj
tj commented

hmm can you post the stack trace?

@codesplicer
Error: Debug
    at Object.<anonymous> (/Users/vik/local_repository/myapp/test/app.test.js:16:10)
    at Module._compile (module.js:404:26)
    at Object..js (module.js:410:10)
    at Module.load (module.js:336:31)
    at Function._load (module.js:297:12)
    at Array.0 (module.js:423:10)
    at EventEmitter._tickCallback (node.js:126:26)
Caught exception: TypeError: Object #<Object> has no method 'listen'
@toxin20

did you solve your problem?

i get the same message using tobi (same code as above). weird thing i also get this using zombiejs or mocha testing tools.

i'm using node 0.6.2 on ubuntu 10.04 and got the modules via npm install

@nagyv

probably you do not export your app from your server

app     = require('../app'),

you should check what app is, my guess is that it's {}

what can you do? simply write in your ../app the following:

var app = module.exports = express.createServer();

to get your app exported

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.