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

Typescript definitions? #81

Closed NullVoxPopuli closed 4 years ago

NullVoxPopuli commented 5 years ago

As I'm picking up percy for the first time, I came across this issue: https://github.com/percy/ember-percy/issues/79

which is very important (and related to importing in general), but also, I was wondering, how would I know what I can important, once I guess at the import path?

dfreeman commented 4 years ago

It looks like this package already ships an index.d.ts with a declaration for percySnapshot (which as far as I know is the only public interface this addon has).

Unfortunately, calling percySnapshot(assert) as documented isn't compatible with the type declaration, because the properties it's expecting on QUnit's assert aren't present in its type definitions, even though they're present at runtime.

From what I can tell, they're not part of QUnit's or ember-qunit's documented API though, so I'm not sure it would make sense to add them to either of those @types packages. @mike-north it looks like you're the original author of those declarations—do you have an opinion on the best way to make them reflect reality?

mike-north commented 4 years ago

I have no opinion regarding these types, except that had I written them today I would certainly have put some tests in place

Robdel12 commented 4 years ago

Looks like this was taken care of in #173 -- thanks @dfreeman 🎉