@brillout/test-e2e 0.3.4 → 0.3.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,2 +1,4 @@
1
1
  export { testScreenshotFixture };
2
- declare function testScreenshotFixture(): Promise<void>;
2
+ declare function testScreenshotFixture({ screenshotFixturePath, }?: {
3
+ screenshotFixturePath?: string;
4
+ }): Promise<void>;
@@ -12,8 +12,9 @@ const path_1 = __importDefault(require("path"));
12
12
  const utils_1 = require("./utils");
13
13
  const getCurrentTest_1 = require("./getCurrentTest");
14
14
  const expect_1 = require("./chai/expect");
15
- async function testScreenshotFixture() {
16
- const { pngFixturPath, pngExpectPath, pngActualPath, pngDifferPath } = getPngPaths();
15
+ async function testScreenshotFixture({ screenshotFixturePath, } = {}) {
16
+ const pngPaths = getPngPaths();
17
+ const pngFixturPath = screenshotFixturePath || pngPaths.pngFixturPath;
17
18
  if (!fs_1.default.existsSync(pngFixturPath)) {
18
19
  const pngActual = await takeScreenshot();
19
20
  const fileContent = pngjs_1.PNG.sync.write(pngActual);
@@ -31,6 +32,7 @@ async function testScreenshotFixture() {
31
32
  (0, expect_1.expect)(numDiffPixels).toBe(0);
32
33
  }
33
34
  catch (err) {
35
+ const { pngExpectPath, pngActualPath, pngDifferPath } = pngPaths;
34
36
  {
35
37
  console.log('Actual image written at', pngActualPath);
36
38
  fs_1.default.writeFileSync(pngActualPath, pngjs_1.PNG.sync.write(pngActual));
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@brillout/test-e2e",
3
- "version": "0.3.4",
3
+ "version": "0.3.5",
4
4
  "bin": "./bin.js",
5
5
  "main": "./dist/index.js",
6
6
  "scripts": {