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

Adding support for function-type saved datasets #9

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

mgiamberardino
Copy link

Feature

The main idea is to be able to save named datasets accepting functions where you can create your datasets based on some extra data given by parameter when creating the fixture.

How to use it

fixtures.save('theName', ({ user }) => {
  const userId = user._id;
  return {
    entry: [{
      _id: '123456',
      user: userId,
      data: ...,
    }],
  };
});
...
fixtures({
  datasetName: 'theName',
  datasetExtras: { user: { _id: 'the_user_id' } },
}, .../* the usual callback */);

@kennethklee
Copy link
Owner

Sorry, I did not see this.

This is awesome! Can you add some documentation to the README.md and a test?

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

Successfully merging this pull request may close these issues.

2 participants