Advertisement
Guest User

Untitled

a guest
Jul 15th, 2019
71
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.47 KB | None | 0 0
  1. const PercyScript = require('@percy/script');
  2. require('dotenv').config();
  3. const fs = require('fs');
  4. (async ()=>{
  5. const dir ='./images';
  6. const blah = await fs.readdirSync(dir)
  7. const images = blah.map(im=>`<img src="${dir}/${im}"/>`)
  8. fs.writeFileSync('output.html', `<html>
  9. ${images}
  10. </html>`, 'utf-8')
  11. })()
  12.  
  13. try {
  14. return PercyScript.run(async (page, percySnapshot) => {
  15. await page.goto('');
  16. await percySnapshot('testing-percy');
  17. });
  18. } catch (e) {
  19. console.error(e);
  20. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement