Automating Mocks in Ionic Native 3.x

By Josh Morony

With the release of Ionic Native 3.x we are now able to create mocks for Ionic Native plugins. If you are not already familiar with the concept of a mock, the basic idea is to create a “fake” class that pretends to be the real class. This is a concept typically used for creating unit tests, but in the case of Ionic Native it is also quite useful for general development.

A lot of plugins that we may use through Ionic Native will only work on a real device, not through the browser. One of the great benefits of using Ionic is being able to quickly test and iterate through the browser, but when we start throwing native plugins into the mix it can get a little bit awkward. However, now we have the ability to mock native plugin functionality whilst we are working in the browser, and then switch to the real thing when we are testing on a device.

Read the full article...

Share on Google Plus

About www.

This is a short description in the author block about the author. You edit it by entering text in the "Biographical Info" field in the user admin panel.
    Blogger Comment
    Facebook Comment


Post a Comment