You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
// The assertion for a promise must be returned.
it('works with promises', () => {
expect.assertions(1);
return user.getUserName(4).then(data => expect(data).toEqual('Mark'));
});
Both Jest and Mocha offer the same Promise-based asynchronous interface:
https://jestjs.io/docs/en/tutorial-async
Alternative syntax based on the same returned promise interface:
https://jestjs.io/docs/en/tutorial-async#resolves
https://jestjs.io/docs/en/tutorial-async#async-await
Currently
storybook-addon-specifications
accepts thedone
async interface, but not the Promise-based one.I'll open a PR in a minute with this functionality implemented.
The text was updated successfully, but these errors were encountered: