Skip to content
This repository has been archived by the owner on Aug 16, 2023. It is now read-only.

Jest support #5

Open
NimaSoroush opened this issue Jun 13, 2017 · 1 comment
Open

Jest support #5

NimaSoroush opened this issue Jun 13, 2017 · 1 comment

Comments

@NimaSoroush
Copy link

Hi, Wondering if there is any possibility to run niffy with Jest?
I was hoping to be able to do something like:

import Niffy from 'niffy';

describe('Header', () => {
  const basehost = 'https://www.google.com/';
  const testhost = 'https://www.google.co.uk/';

  let niffy;

  beforeAll(() => {
    niffy = new Niffy(basehost, testhost, { show: true });
  });

  afterAll(() => {
    niffy.end();
  });

  it('running visual regression tests', () => {
    niffy.goto('/?x=true');
    return niffy.test('/?x=true');
  });
});

Is there any plan for Jest support?

@fiuzagr
Copy link

fiuzagr commented Nov 27, 2017

Niffy is compatible with Jest.

Should be like:

import Niffy from 'niffy';
import co from 'co';

jest.setTimeout(200 * 1000);

describe('Header', () => {
  const basehost = 'https://www.google.com/';
  const testhost = 'https://www.google.co.uk/';

  let niffy;

  beforeAll(() => {
    niffy = new Niffy(basehost, testhost, { show: true });
  });

  afterAll(async () => {
    await co(function * () {
      return yield niffy.end();
    });
  });

  it('running visual regression tests', async () => {
    await co(function * () {
      return yield niffy.test('/');
    });
  });
});

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants