Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Create custom snapshot renderer #87

Open
JakeSidSmith opened this issue Jan 31, 2018 · 0 comments
Open

Create custom snapshot renderer #87

JakeSidSmith opened this issue Jan 31, 2018 · 0 comments
Labels
tests 🔬 Improvements to tests

Comments

@JakeSidSmith
Copy link
Owner

JakeSidSmith commented Jan 31, 2018

This should stub the CanvasRenderingContext2D and create an ascii representation that is written to a file to check for changes later.

expect(context).toMatchCanvasSnapshot();
expect.extend({
  toMatchCanvasSnapshot(received, argument) {
    const pass = //;

    if (pass) {
      return {
        message: () => `expected ${received} not to match snapshot ${snapshot}`,
        pass: true,
      };
    } else {
      return {
        message: () => `expected ${received} to match snapshot ${snapshot}`,
        pass: false,
      };
    }
  }
});
@JakeSidSmith JakeSidSmith added the tests 🔬 Improvements to tests label Feb 23, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
tests 🔬 Improvements to tests
Projects
None yet
Development

No branches or pull requests

1 participant