How to use backstopjs - 4 common examples

To help you get started, we’ve selected a few backstopjs examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github DefinitelyTyped / DefinitelyTyped / types / backstopjs / backstopjs-tests.ts View on Github external
import backstop, { Scenario, Viewport } from 'backstopjs';

/** Examples inspired on https://github.com/garris/BackstopJS#integration-options-local-install */

backstop('approve').then(() => { }).catch(() => { });

backstop('init');

backstop('reference', {
  filter: 'someScenarioLabelAsRegExString'
});

backstop('test', { config: 'custom/backstop/config.json' });

backstop('test', {
  filter: 'someScenarioLabelAsRegExString',
  config: {
    id: 'foo',
    scenarios: [],
    viewports: [],
    dockerCommandTemplate:
      'docker run --rm -it --net="host" --mount type=bind,source="{cwd}",target=/src backstopjs/backstopjs:{version} {backstopCommand} {args}',
  },
});

/** Custom example */

const scenarios: Scenario[] = [
  {
    label: 'Microsoft',
    url: 'https://microsoft.com/',
github DefinitelyTyped / DefinitelyTyped / types / backstopjs / backstopjs-tests.ts View on Github external
import backstop, { Scenario, Viewport } from 'backstopjs';

/** Examples inspired on https://github.com/garris/BackstopJS#integration-options-local-install */

backstop('approve').then(() => { }).catch(() => { });

backstop('init');

backstop('reference', {
  filter: 'someScenarioLabelAsRegExString'
});

backstop('test', { config: 'custom/backstop/config.json' });

backstop('test', {
  filter: 'someScenarioLabelAsRegExString',
  config: {
    id: 'foo',
    scenarios: [],
    viewports: [],
    dockerCommandTemplate:
      'docker run --rm -it --net="host" --mount type=bind,source="{cwd}",target=/src backstopjs/backstopjs:{version} {backstopCommand} {args}',
  },
});
github DefinitelyTyped / DefinitelyTyped / types / backstopjs / backstopjs-tests.ts View on Github external
import backstop, { Scenario, Viewport } from 'backstopjs';

/** Examples inspired on https://github.com/garris/BackstopJS#integration-options-local-install */

backstop('approve').then(() => { }).catch(() => { });

backstop('init');

backstop('reference', {
  filter: 'someScenarioLabelAsRegExString'
});

backstop('test', { config: 'custom/backstop/config.json' });

backstop('test', {
  filter: 'someScenarioLabelAsRegExString',
  config: {
    id: 'foo',
    scenarios: [],
    viewports: [],
    dockerCommandTemplate:
github DefinitelyTyped / DefinitelyTyped / types / backstopjs / backstopjs-tests.ts View on Github external
import backstop, { Scenario, Viewport } from 'backstopjs';

/** Examples inspired on https://github.com/garris/BackstopJS#integration-options-local-install */

backstop('approve').then(() => { }).catch(() => { });

backstop('init');

backstop('reference', {
  filter: 'someScenarioLabelAsRegExString'
});

backstop('test', { config: 'custom/backstop/config.json' });

backstop('test', {
  filter: 'someScenarioLabelAsRegExString',
  config: {
    id: 'foo',
    scenarios: [],
    viewports: [],
    dockerCommandTemplate:
      'docker run --rm -it --net="host" --mount type=bind,source="{cwd}",target=/src backstopjs/backstopjs:{version} {backstopCommand} {args}',
  },

backstopjs

BackstopJS: Catch CSS curveballs.

MIT
Latest version published 1 month ago

Package Health Score

89 / 100
Full package analysis

Popular backstopjs functions