How to debug Storyshots test generation issues

351 Views Asked by At

I'm working on a project that uses Storybook with Storyshots addon. The Jest tests contain a crawler that generates tests based on Storybook stories. When test generation process goes wrong Jest tells me Your test suite must contain at least one test. Is there anyway to get more accurate information about what went wrong? At one point I might have a substantial amount of working tests and in the next moment one problematic story might take that back to zero.

See full error with stack trace below

 FAIL  ./storyshots.test.ts
  ● Test suite failed to run

    Your test suite must contain at least one test.

      at onResult (node_modules/@jest/core/build/TestScheduler.js:175:18)
      at node_modules/@jest/core/build/TestScheduler.js:304:17
      at node_modules/emittery/index.js:260:13
          at Array.map (<anonymous>)
      at Emittery.Typed.emit (node_modules/emittery/index.js:258:23)

The initStoryshots call looks as follows

initStoryshots({
  framework: 'react',
  configPath: path.join(__dirname, '.storybook'),
  integrityOptions: { cwd: path.join(__dirname, 'src') },
  test: multiSnapshotWithOptions(),
});
1

There are 1 best solutions below

0
On

That message can be thrown for many reasons, try the --verbose option of jest for more feedback