Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- const PercyScript = require('@percy/script');
- require('dotenv').config();
- const fs = require('fs');
- (async ()=>{
- const dir ='./images';
- const blah = await fs.readdirSync(dir)
- const images = blah.map(im=>`<img src="${dir}/${im}"/>`)
- fs.writeFileSync('output.html', `<html>
- ${images}
- </html>`, 'utf-8')
- })()
- try {
- return PercyScript.run(async (page, percySnapshot) => {
- await page.goto('');
- await percySnapshot('testing-percy');
- });
- } catch (e) {
- console.error(e);
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement