node package manager
Painless code sharing. npm Orgs help your team discover, share, and reuse code. Create a free org »


logo poker npm

a smart signin simulator and test accounts switcher base on Node

How to install

$ npm install poker

Sample code

// require poker 
var Poker = require('poker');
// init a poker 
// watch out replace passport from keywords 
var poker = new Poker('');
// add test account and then signin 
    alias: 'testAccountNo.1',
    username: 'abc',
    password: '123'
}).mock(function(err, res, result){
// add as much accounts as you like 
        alias: 'testAccountNo.1',
        username: 'abc',
        password: '123'
        alias: 'testAccountNo.2',
        username: 'admin',
        password: '21212'
        alias: 'testAccountNo.3',
        username: 'sqwsqws',
        password: '112312323'
// switch to selected user will signin automatically 
poker.mock('testAccountNo.1',function(err, res, result){


  • multiple test accounts supported
  • account quick switch supported
  • cookie supported

Pull Request Welcome !

  • fork this repo
  • feel free to add your feature
  • make sure your feature are fully tested!
  • send me a PR, and enjoy !