Code Monkey home page Code Monkey logo

jest-puppe-shots's Introduction

Hello World!

jest-puppe-shots's People

Contributors

apieceofbart avatar dustincomp avatar macku avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

jest-puppe-shots's Issues

Problem with testing components when component size has been changed

Hello
We have a problem with testing react components, when its size has been changed, in such case jest-image-snapshots throws error "toMatchImageSnapshot(): Received image size must match baseline snapshot size in order to make comparison."
In general that's not a problem when creating screenshot of whole page, but jest-puppe-shots makes screenshot of small part of it and it can differ in size in such case as adding new line to component.
I thought about always creating big screenshot (something like 1000x1000px) but comparision of such big screenshots takes too long.
I tried to come up with another solution, unfortunately I couldn't find any, so I could use any help with this issue. :)

Allow setupTests config

Hi,

I try to use it with create-react-app, however it doesn't allow altering jest preset without ejecting.

Is it possible to setup jest-puppe-shots in setupJest.js file?

Mounting Additional CSS Example has error

This example is not a valid use of path.resolve() and following this format will throw an error.

 await page.mountCssContext(path.resolve('../path/to/my-assets-dir', [
    'css/reset.css',
    'css/custom-styles.css'
  ]))

I've tried altering it to this, but

 await page.mountCssContext(path.resolve('build'), [
    'style.css'
  ])

But I am consistently getting the error Error: loading style from build/style.css. Can you provide an updated additional css example that is working correctly?

Tests throws error when rendered output has new lines

Hello
There is a problem when rendered output has new lines. Most of the time that's not a problem, but svg elements can have new lines in path elements.
In my case that was:

<svg>
<path d={`M150 0 
L75 200 
L225 200 Z`} />
</svg>

The problem is in this fragment (lib/renderer/common.js , line 1):

const wrapReactHtmlOutput = html => `document.body.innerHTML = '${html.replace("'", "\\'")}'`;

all you have to do is to change it so it uses template literals:

const wrapReactHtmlOutput = html => `document.body.innerHTML = \`${html.replace("'", "\\'")}\``;

also now I'm not sure if this replace is even needed, as variable html isn't surrounded by it anymore.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.