Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
(async () => {
// If a build is from a forked repository, CircleCI does not pass environment
// environment variables into the build to prevent credential leakage.
// In that case, exit cleanly so the build does not fail.
// Once we start using @percy/puppeteer v1 this can be removed as it is
// checked within Percy. See https://github.com/percy/percy-puppeteer/pull/3
if (!process.env.PERCY_TOKEN) {
console.log('No PERCY_TOKEN provided. Skipping snapshots.');
process.exit();
}
const percy = new Percy({
loaders: [
new FileSystemAssetLoader({
buildDir: './playground/build/assets',
mountPath: '/assets',
}),
],
});
const browsers = [
{
browser: await puppeteer.launch(),
taken: new Promise((resolve) => {
resolve();
}),
},
{