File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1+ // Define missing DOMMatrix in Node context (for pdfjs)
2+ if ( typeof global . DOMMatrix === "undefined" ) {
3+ global . DOMMatrix = class DOMMatrix { } ;
4+ }
5+
16const { defineConfig } = require ( "cypress" ) ;
27const fs = require ( "fs" ) ;
38const path = require ( "path" ) ;
4- const pdfjsLib = require ( "pdfjs-dist/legacy/build/pdf.js " ) ;
9+ const pdfjsLib = require ( "pdfjs-dist/legacy/build/pdf.mjs " ) ;
510const { PNG } = require ( "pngjs" ) ;
611const sharp = require ( "sharp" ) ;
712
8- // Define missing DOMMatrix in Node context (for pdfjs)
9- if ( typeof global . DOMMatrix === "undefined" ) {
10- global . DOMMatrix = class DOMMatrix { } ;
11- }
13+
1214
1315module . exports = defineConfig ( {
1416 e2e : {
@@ -69,7 +71,15 @@ module.exports = defineConfig({
6971
7072 if ( doLogoCheck && args [ 0 ] ) {
7173 const objName = args [ 0 ] ;
72- const imgData = await page . objs . get ( objName ) ;
74+ const imgData = await new Promise ( ( resolve ) => {
75+ try {
76+ page . objs . get ( objName , ( data ) => resolve ( data ) ) ;
77+ }
78+ catch ( e ) {
79+ resolve ( null ) ;
80+ }
81+ } ) ;
82+
7383 if ( ! imgData ) {
7484 continue ;
7585 }
You can’t perform that action at this time.
0 commit comments