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

support returning promises from dynamic fixtures #164

Merged
merged 5 commits into from
Apr 24, 2019

Conversation

christopherjbaker
Copy link
Contributor

This would allow a lot more flexibility in the use of fixtures, including allowing fixtures to depend on each other, creating route-specific delays, and even allowing resolution from external sources. It would also make it integrate nicely with async/await without adding weight to the library.

fixture('/', async (req, res) => {
  await wait(5000);
  return res({
    foo: 'bar'
  });
});

Copy link
Member

@chasenlehara chasenlehara left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is a great addition! Let’s get this merged in as soon as docs are added.

test/fixture_test.js Outdated Show resolved Hide resolved
@christopherjbaker
Copy link
Contributor Author

I've got a bit to catch up on with my client, but Ill try to get docs in this week.

Copy link
Member

@chasenlehara chasenlehara left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍 Left one suggestion.

docs/can-fixture.md Outdated Show resolved Hide resolved
@christopherjbaker christopherjbaker merged commit fb0e597 into master Apr 24, 2019
@christopherjbaker christopherjbaker deleted the dev/support-promises branch April 24, 2019 22:58
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