Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

pass inserted items to callback? #20

Open
benwilhelm opened this issue Feb 18, 2014 · 0 comments
Open

pass inserted items to callback? #20

benwilhelm opened this issue Feb 18, 2014 · 0 comments

Comments

@benwilhelm
Copy link

Is it possible to pass the newly inserted fixtures to your callback, so you don't have to query your database in your tests? I'm thinking something along the lines of:

// fixtures/user.js
module.exports.User = {
  admin: { email:'admin@example.com' , ... },
  user_1: { email:'user1@example.com', ... },
  user_2: { email:'user2@example.com', ... }
}

// tests.js
setup(function(done){
  fixtures.load('./users.js', function(users){
    self.users = users;
    done(); 
  })
});

test("Example Test", function(done){
  app.login(self.users.user_1);
  // test something here
  done();
});

If this is something you're interested in, I'd be happy to contribute a patch. Otherwise I'll probably just wrap your fixture module in my own module to accomplish the same thing in my project.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant