percy / percy-ember

Ember addon for visual regression testing with Percy
https://docs.percy.io/docs/ember
MIT License
73 stars 44 forks source link

Create test helper that works in new ember test framework #60

Closed habdelra closed 6 years ago

habdelra commented 6 years ago

The current percySnapshot test helper should be updated to work in the new ember testing framework http://rwjblue.com/2017/10/23/ember-qunit-simplication/

One of the changes is that the way test helpers are created has changed. registerAsyncHelper is no longer used. Rather test helpers are just plain functions that use import { getContext } from '@ember/test-helpers'; to get access to the container.

Take a look here for an example of an async test helper using the new test framework: https://github.com/ember-animation/ember-animated/blob/f9e4722ca54ffc163f0adfdb4f8fe2fb5a4dc949/addon-test-support/index.js#L11-L18

fotinakis commented 6 years ago

@habdelra I believe you can already do this with:

import { percySnapshot } from 'ember-percy';

Let me know if that doesn't work.

habdelra commented 6 years ago

sure that worked. do you think you can update your docs for this? as the start-app.js and .eslintrc don't have to be modified in this scenario