Skip to content

Commit

Permalink
e2e: Clean up.
Browse files Browse the repository at this point in the history
  • Loading branch information
mrdoob committed May 26, 2020
1 parent d6f668f commit a383ff2
Showing 1 changed file with 8 additions and 7 deletions.
15 changes: 8 additions & 7 deletions test/e2e/puppeteer.js
Expand Up @@ -8,8 +8,8 @@ try {

} catch {

console.log( '\x1b[31mError! You not installed dependencies. Please run `npm i --prefix test`\x1b[37m' );
process.exit( 1 );
console.log( 'Error: Can\'t find Puppeteer. Run `npm install --prefix test`.' );
process.exit( 0 );

}

Expand Down Expand Up @@ -188,6 +188,7 @@ const pup = puppeteer.launch( {
console.log( 'Warning. Render timeout exceeded...' );

}

clearInterval( waitingLoop );
resolve();

Expand Down Expand Up @@ -223,9 +224,9 @@ const pup = puppeteer.launch( {
/* Make screenshots */

attemptId = maxAttemptId;
let bitmap= ( await jimp.read( await page.screenshot() ) )
.scale( 1 / viewScale ).quality( jpgQuality )
.write( `./examples/screenshots/${ file }.jpg` ).bitmap;
let bitmap = ( await jimp.read( await page.screenshot() ) )
.scale( 1 / viewScale ).quality( jpgQuality )
.write( `./examples/screenshots/${ file }.jpg` ).bitmap;

printImage( bitmap, console );
console.green( `file: ${ file } generated` );
Expand Down Expand Up @@ -258,8 +259,8 @@ const pup = puppeteer.launch( {
continue;

}
numFailedPixels /= actual.width * actual.height;

numFailedPixels /= actual.width * actual.height;

/* Print results */

Expand Down Expand Up @@ -304,7 +305,7 @@ const pup = puppeteer.launch( {

if ( failedScreenshots.length > 1 ) {

console.red( 'List of failed screenshots: ' + failedScreenshots.join(' ') );
console.red( 'List of failed screenshots: ' + failedScreenshots.join( ' ' ) );

} else {

Expand Down

0 comments on commit a383ff2

Please sign in to comment.