Skip to content

Commit

Permalink
chore: refactor
Browse files Browse the repository at this point in the history
  • Loading branch information
nsbarsukov committed Oct 3, 2024
1 parent 186d26a commit 8127840
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 4 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/e2e.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ env:
CYPRESS_BASELINE_REPO: 'baseline'
CYPRESS_RESULTS_FOLDER: 'projects/demo-cypress/tests-results'
CYPRESS_BASELINE_SNAPSHOTS: 'projects/demo-cypress/tests-results/snapshots/baseline'
CYPRESS_CACHE_FOLDER: '~/node_modules/cache-cypress'

jobs:
build-demo:
Expand Down Expand Up @@ -127,6 +126,7 @@ jobs:
- name: Combine images to get diff reports
run: |
npm install canvas
npm view canvas version
npx ts-node ./scripts/visual-testing/combine-playwright-failed-screenshots.ts
- name: Debug output
Expand Down
4 changes: 1 addition & 3 deletions scripts/visual-testing/combine-snapshots.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,11 @@
* (not friendly for our external contributors).
* https://github.com/Automattic/node-canvas/issues/1511
*/
import {createCanvas, loadImage, version} from 'canvas';
import {createCanvas, loadImage} from 'canvas';

export async function combineSnapshots(
imagesPaths: string[],
): Promise<NodeJS.ArrayBufferView> {
console.info('canvas:', version);

const images = await Promise.all(imagesPaths.map(loadImage));
const totalWidth = images.reduce((acc: number, {width}) => acc + width, 0);
const maxHeight = Math.max(...images.map(({height}) => height));
Expand Down

0 comments on commit 8127840

Please sign in to comment.