Skip to content

Releases: dferber90/jsdom-screenshot

v4.0.0

03 Nov 07:01
966130a
Compare
Choose a tag to compare

This is marked as a breaking change as the generated screenshots might change. There were no breaking changes in the API itself.

v3.2.0

23 May 16:29
dd48427
Compare
Choose a tag to compare

Features

It's now possible to pass targetSelector to generateImage to specify which element to take a screenshot of.

import React from "react";
import { generateImage, setDefaultOptions } from "jsdom-screenshot";
import { render } from "react-testing-library";
import { SomeComponent } from "<your-code>";

it("should have no visual regressions", async () => {
  // display: "table" prevents div from using full width,
  // so the screenshot would not cover the full width here
  render(
    <div data-testid="root" style={{ display: "table" }}>
      <SomeComponent />
    </div>
  );

  const image = await generateImage({
    targetSelector: "[data-testid=root]"
  });
  expect(image).toMatchImageSnapshot();
});

See README for more information.

Tests

Added primitive smoke-tests.

v3.1.1

21 Dec 15:02
20e2521
Compare
Choose a tag to compare

Fixed

  • c3eef4d avoid object spread in debug function

v3.1.0

28 Oct 10:16
385af38
Compare
Choose a tag to compare

Added

  • 5624e29 Added setDefaultOptions and restoreDefaultOptions to allow global definition of the options for generateImage. See the updated docs for more information.

v3.0.2

23 Sep 19:18
23af90c
Compare
Choose a tag to compare

Fixed

  • 7deb63c reenable request interception

v3.0.1

23 Sep 19:13
b3e4188
Compare
Choose a tag to compare

Accidental release with no changes.

v3.0.0

23 Sep 19:02
b3e4188
Compare
Choose a tag to compare

Changed

  • 51cc6e9 rename waitForResources to waitUntilNetworkIdle and default to false
  • 06b5b6b rename options.publicPaths to options.serve
  • 84cd5d2 rename options.requestInterception to options.intercept

Upgrade guide

await generateImage({
- waitForResources: true,
- publicPaths: ['asstes'],
- requestInterception: () => {},
+ waitUntilNetworkIdle: true,
+ serve: ['asstes'],
+ intercept: () => {},
})

When you were relying on remote resources but they your setup did not specify this, then you need to declare it explicitly now.

await generateImage({
+ waitUntilNetworkIdle: true  
})

v2.1.0

23 Sep 11:36
ac598f2
Compare
Choose a tag to compare

Added

  • ac598f2 Add local webserver and options.publicPath option

Instead of using the page.goto(`data:text/html,${html}`) approach of puppeteer/puppeteer#728 (comment) jsdom-screenshot now starts its own webserver to serve the html. This enables serving local assets for the screenshot. It further enables intercepting requests to local assets. See the updated README for more information.

v2.0.0

23 Sep 08:48
ef4de3d
Compare
Choose a tag to compare

Added

  • ef4de3d Add options.screenshot to influence the screenshot puppeteer takes

Changed

  • 1751e60 options.launchOptions is now options.launch

Fixed

Upgrade guide

In case you were passing generateImage({ launchOptions: launchOptions }) you now need to pass generateImage({ launch: launchOptions }).

v1.0.0

22 Sep 20:20
672a144
Compare
Choose a tag to compare

First public release. No changes compared to previous version.

Moving to 1.0.0 to indicate the beginning fo semantic versioning.