KnitUI icon indicating copy to clipboard operation
KnitUI copied to clipboard

Add storyshots

Open Kushagra8888 opened this issue 5 years ago • 0 comments

https://storybook.js.org/docs/testing/structural-testing/

Since we are already using storybooks, the stories can be used as jest snaphost test using this addon. I've attempted to integrate it but encountered some issues which I could not resolve...

yarn run v1.15.2
$ jest --verbose=false --no-cache
 FAIL  components/Button/__tests__/storyshots.test.js
  ● Test suite failed to run

    /home/kushagra/work/clarisghts/KnitUI/components/assets/fonts/Inter-Thin-BETA.woff:1
    ({"Object.<anonymous>":function(module,exports,require,__dirname,__filename,global,jest){wOFF
                                                                                                 

    SyntaxError: Invalid or unexpected token

    > 1 | const InterThin = require("../assets/fonts/Inter-Thin-BETA.woff")
        |                   ^
      2 | const InterLight = require("../assets/fonts/Inter-Light-BETA.woff")
      3 | const InterRegular = require("../assets/fonts/Inter-Regular.woff")
      4 | const InterMedium = require("../assets/fonts/Inter-Medium.woff")

      at ScriptTransformer._transformAndBuildScript (node_modules/@jest/transform/build/ScriptTransformer.js:471:17)
      at ScriptTransformer.transform (node_modules/@jest/transform/build/ScriptTransformer.js:513:25)
      at Object.<anonymous> (components/styles/fonts.tsx:1:19)

Kushagra8888 avatar May 03 '19 09:05 Kushagra8888