zombie-passport-twitter

Headless "Sign In with Twitter"

$ npm install zombie-passport-twitter
var zpt = require('zombie-passport-twitter')
 
zpt.signIn({
    url: '/auth/twitter',
    username: YOUR_USERNAME,
    password: YOUR_PASSWORD,
    wait: 5e3
}, function(errbrowser){
    // you're signed in! 
})

You can use the session to sign additional requests, using supertest for example:

zpt.signIn(YOUR_OPTIONS, function(errbrowser){
    supertest(YOUR_SERVER)
        .get('/')
        .set('cookie', browser.cookies[0].toString())
        .expect(200)
})

Create a file ./test/config.json:

{
  "username": "YOUR_USERNAME",
  "password": "YOUR_PASSWORD",
  "consumerKey": "YOUR_CONSUMER_KEY",
  "consumerSecret": "YOUR_CONSUMER_SECRET"
}

Then run:

$ grunt test