🚨 Shai-Hulud Strikes Again:834 Packages Compromised.Technical Analysis →
Socket
Book a DemoInstallSign in
Socket

emailonacid-snapshot

Package Overview
Dependencies
Maintainers
1
Versions
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

emailonacid-snapshot

Mails visual regression tooling via Email on Acid service

latest
npmnpm
Version
3.9.3
Version published
Maintainers
1
Created
Source

emailonacid-snapshot

Mail Visual Regression library based on Email on Acid API service.

Quick Start

  • Install emailonacid-snapshot package as devDependency:
# yarn
yarn add --dev emailonacid-snapshot

# npm
npm install --save-dev emailonacid-snapshot
  • Define process.env.EOA_API_KEY and process.env.EOA_ACCOUNT_PASSWORD API credentials.

  • Use createEmail with your favorite test runner:

const { createEmail } = require('emailonacid-snapshot');

async function run() {
  const email = await createEmail('<html><!-- static markup --></html>');
  const screenshot = await email.screenshot('outlook07');
  // assert screenshot at this point
  await email.clean();
}

run();

Check options docs and examples for futher setup.

Options

You can provide config with either one of package.json#emailonacid, emailonacid.config.js, and .emailonacidrc.json.

Note: clients and plugins options are not merged but overridden.

  • clients <?Array<string>> List of default clients to create tests with.
  • credentials <Object>
    • apiKey <string> EoA API key. Defaults to process.env.EOA_API_KEY.
    • accountPassword EoA API password. Defaults to process.env.EOA_ACCOUNT_PASSWORD.
  • debug <?boolean> Enables verbose debug logging. Defaults to process.env.DEBUG or process.env.EOA_DEBUG.
  • plugins <?Array<Function>> List of plugins to apply for each test. Default plugins are ThreadBustingPlugin, ContentRendererPlugin, LocalCopyPlugin, ContentCroppingPlugin. If you're willing to implement custom plugin, check one of those plugins for reference.
  • poll <?Object> Polling options
    • interval <number> Polling interval. Defaults to 2.5e3 (2.5 sec).
    • timeout <number> Polling timeout. Defaults to 300e3 (5 min).

API

See TypeScript typings for more API details.

createEmail

import { createEmail } from 'emailonacid-snapshot';

Creates new email with default and global options. Returns email instance object.

configureCreateEmail

import { configureCreateEmail } from 'emailonacid-snapshot';

Creates new email factory with default, global and provided options. Helpful for creating multiple createEmail functions to defined different set of targets or different renderers.

withDefaultPlugins

import { withDefaultPlugins } from 'emailonacid-snapshot/config';

Merges user-provided config with list of default plugins.

withOverridableClients

import { withOverridableClients } from 'emailonacid-snapshot/config';

Merges user-provided config with a dynamic list of clients which can be overridden via EOA_CLIENTS environment variable.

License

MIT Š ResearchGate

FAQs

Package last updated on 29 May 2019

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts