kpdecker

kpdecker

Member Since 11 years ago

Chicago, IL

Experience Points
388
follower
Lessons Completed
38
follow
Lessons Completed
116
stars
Best Reply Awards
127
repos

1024 contributions in the last year

Pinned
⚡ Minimal templating on steroids.
⚡ The Simple, Secure Framework Developers Trust
⚡ A javascript text differencing implementation.
⚡ ES6 polyfill vs. feature performance tests
⚡ WYSIWYG editor for border-image styles
⚡ Server-side jQuery API renderer.
Activity
Oct
5
2 months ago
push

kpdecker push kpdecker/dotfiles

kpdecker
kpdecker

Update supported code cov file formats

commit sha: 04e616e7e1f844985a40ac560fa81db17e87a2cf

push time in 2 months ago
Oct
3
2 months ago
Activity icon
issue

kpdecker issue comment storybookjs/storybook

kpdecker
kpdecker

HELP: Storyshots found 0 stories (Storybook v6 beta)

Support request

Need help with setting up Storyshots. I am always getting the following error when I run npm test:

> jest tests

 FAIL  tests/storyshots.test.js
  ● Test suite failed to run

    storyshots found 0 stories

      2 | import initStoryshots, { multiSnapshotWithOptions } from '@storybook/addon-storyshots';
      3 | 
    > 4 | initStoryshots({
        | ^
      5 |     framework: 'html',
      6 |     integrityOptions: { cwd: path.resolve(__dirname, '../stories') },
      7 |     configPath: path.resolve(__dirname, '../.storybook'),

      at testStorySnapshots (node_modules/@storybook/addon-storyshots/dist/api/index.js:108:15)
      at Object.<anonymous> (tests/storyshots.test.js:4:1)

Test Suites: 1 failed, 1 total
Tests:       0 total
Snapshots:   0 total
Time:        4.028 s
Ran all test suites matching /tests/i.
(node:20997) ExperimentalWarning: The fs.promises API is experimental
npm ERR! Test failed.  See above for more details.

My settings

jest.config.js

module.exports = {
    moduleNameMapper: {
        '^.+\\.(css|less|scss)$': 'babel-jest'
    },
    transform: {
        '^.+\\.js$': 'babel-jest'
    },
    moduleFileExtensions: ['js', 'json']
};

tests/storyshots.test.js

import path from 'path';
import initStoryshots, { multiSnapshotWithOptions } from '@storybook/addon-storyshots';

initStoryshots({
    framework: 'html',
    integrityOptions: { cwd: path.resolve(__dirname, '../stories') },
    configPath: path.resolve(__dirname, '../.storybook'),
    test: multiSnapshotWithOptions()
});

stories/button.stories.js

export default {
    title: 'Components|Button',
};

export const basic = () => '<button>Click me!</button>';

Folder structure

  • .storybook
    • main.js
    • preview.js
  • src
  • stories
    • button.stories.js
  • tests
    • storyshots.test.js
  • jest.config.js
kpdecker
kpdecker

I was able to resolve one instance of this by using module.exports = rather than export default in main.ts.

https://github.com/storybookjs/storybook/blob/8d7fa4249cc73f315cfc15ebd8c6f0d574f341d5/addons/storyshots/storyshots-core/src/frameworks/configure.ts#L53

Does not appear to be aware of default export which works for other parts of storybook.