storybook-addon-specifications icon indicating copy to clipboard operation
storybook-addon-specifications copied to clipboard

Promise asynchronous interface

Open michaelgallaghertw opened this issue 6 years ago • 0 comments

Both Jest and Mocha offer the same Promise-based asynchronous interface:

https://jestjs.io/docs/en/tutorial-async

// 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'));
});

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 the done async interface, but not the Promise-based one.

I'll open a PR in a minute with this functionality implemented.

michaelgallaghertw avatar Sep 10 '18 18:09 michaelgallaghertw