Storybook: jest-addon is not getting any jest-test-results

Created on 19 Oct 2018  路  5Comments  路  Source: storybookjs/storybook

Bug or support request summary

It seems that jest-addon is not getting any jest-test-results, resulting in message: This story has tests configured, but no file was found

Steps to reproduce

You can find the same message here https://storybooks-official.netlify.com/?selectedKind=Addons%7Cjest&selectedStory=withTests&full=0&addons=1&stories=1&panelRight=0&addonPanel=storybook%2Ftests%2Fpanel

Please specify which version of Storybook and optionally any affected addons that you're running

  • @storybook/react 4.0.0-rc.1
  • @storybook/addon-something 4.0.0-rc.1

Where to start

It might be related to this issue https://github.com/storybooks/storybook/issues/4453

jest bug

Most helpful comment

Workaround similar to above worked for me, currently the addon is concatting the string in findTestResults there's no regex involved just a String.includes check.

addDecorator(
    withTests({
        results,
        filesExt: ".test.tsx", // tsx in my case!
    }),
);

All 5 comments

Looks appeared after #3983.

I ran into this issue today. a working config for the withTests function looks like this currently:

import jestResults from '../jest-test-results.json';

  withTests({
    filesExt: { filesExt: ".spec.js" },
    results: jestResults
  })

filesExt doesn't look to support regex either.

@aschlick do you think you could help us get the addon-jest into a better shape?

Sure! Hopefully I'll get a pull request together within a week or so.

Workaround similar to above worked for me, currently the addon is concatting the string in findTestResults there's no regex involved just a String.includes check.

addDecorator(
    withTests({
        results,
        filesExt: ".test.tsx", // tsx in my case!
    }),
);
Was this page helpful?
0 / 5 - 0 ratings

Related issues

wahengchang picture wahengchang  路  3Comments

dnlsandiego picture dnlsandiego  路  3Comments

arunoda picture arunoda  路  3Comments

shilman picture shilman  路  3Comments

alexanbj picture alexanbj  路  3Comments