-
Notifications
You must be signed in to change notification settings - Fork 53
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Make fakeAddon a helper using createInternalAddon, not an object #10819
Comments
We started to use various const createFakeAddon = (props = {}) => createInternalAddon({ ...fakeAddon, ...props }); That would ease the migration. |
We just need to be careful that everyone understands the naming conventions. Personally, I'm happy with just having As an aside, I've also come across a few tests recently where we were using an internal object when we really should have been using an external object. This can happen especially with |
Yep, that makes sense. I like the naming conventions suggested here.
Yep, I've seen that too.. |
Using
fakeAddon
isn't perfect and @kumar303 pointed out we should wrap it increateInternalAddon()
fromcore/reducers/addons
, but this leads to a LOT of boilterplate in tests. See: mozilla/addons-frontend#3203 (comment)What we should really have is a
fakeAddon()
helper that takes extra props, overriding the defaults in thefakeAddon
object and returns the result ofcreateInternalAddon()
.The text was updated successfully, but these errors were encountered: