0

我正在使用@storybook/addon-storyshots-puppeteer。

import myReporter from 'xxxx';

const afterScreenshot = ({ image, context }) => {
  return new Promise((resolve) =>
    setTimeout(() => {
      const isTestPass = yyy;
      myReporter.info(`test status: ${isTestPass}`); 
      //console.log(context, image);
      resolve();
    }, 600)
  );
};

initStoryshots({
  suite: `Image storyshots ${os.platform()}`,
  test: imageSnapshot({ storybookUrl: global.storybook.localhost, afterScreenshot })
});

我正在尝试获取每个测试状态,以便将其添加到我的记者中。

我读到我可以使用 afterScreenshot 但我不知道测试状态。

我怎样才能实现它?谢谢!

4

0 回答 0