skellock / typescript-with-electron-react-kit

Don't just start your Electron app... TWERKit.
https://skellock.github.io/typescript-with-electron-react-kit
MIT License
145 stars 23 forks source link

Add storyshots #101

Closed skellock closed 6 years ago

skellock commented 6 years ago

I took a run at getting this integrated, but I failed.

@rmevans9 does anything obvious pop out here on the storyshots branch?

What's happening is it doesn't seem to be loading webpack.config.js when running in jest mode.

When i run the test it gives me:

image

Unexpected character '�' (1:0)
      > 1 | ����JFIFHH��@ExifMM�i�,����8Photoshop 3.08BIM8BIM%��ُ�� ���B~��,"��
          | ^
        2 |
            ���}!1AQa"q2��#B��R��$3br�
        3 | %&'()*456789:CDEFGHIJSTUVWXYZcdefghijstuvwxyz���������������������������������������������������������������������������
        4 |
            ���w!1AQaq"2B����   #3R�br�

It looks like it's tripping up on the const dogImage = require('./fun-dog.jpg') line. That strikes me as a webpack loader not loading the image.

I tried to bring in url-loader and file-loader to fix it, but didn't seem to work. It only broke storybook as it currently works in the app.

I then realized that, in jest mode, it's not even loading that webpack config. You can verify by putting a syntax error in that file.

I went looking in @storybook/addon-storyshots, but there's literally no files to debug in there. ha!

We're using fuse-box to bundle, but that doesn't seem to bother storybook?

I'm probably doing something stupid, but I've burned more hours than I'm prepared to admit.

=)

Any insights?

skellock commented 6 years ago

Here's what he said:

image