Testing, similar to documentation, leaves most developers with one of two reactions: they either cherish it or they abhor it. Regardless of whether you’re an obstinate promoter for putting your code through unit testing, persistent incorporation tests and ease of use testing (to give some examples more elevated amount approaches that may be taken) or just a designer who hurls in a couple of support logs all over as an absolute minimum for testing there’s no getting away from the way that your code should be tried.
Presently, since we really have something to take a gander at, we have to discuss the testing and advancement process for our application. There are four different ways to test your application as you create: in a work area WebKit program, in the iOS or Android test system, in a mobile browser on your phone, or as a native application on the phone.
Ionic developers can benefit from using these browser tools by running ionic projects with the following Ionic CLI command:
You can likewise test the application straightforwardly in a mobile browser. For OS X clients, Safari on OS X can specifically troubleshoot sites and test system applications. First, you need to empower the remote web examiner on both the gadget and Safari on the work area. To do this with iOS 7 and OS X Mavericks, empower the Web Inspector choice in the iOS Settings – > Safari – > Advanced area, and furthermore empower the Developer Menu in the Advanced segment of the Safari OS X settings.
The Console API provides a number of methods that allow developers to test their code in the following ways:
You can also test right in the simulator using the Cordova commands from the previous chapter. For example, to test in the iOS simulator, run:
$ ionic Cordova build ios
$ ionic Cordova emulate ios
Substitute iOS with Android for Android testing. In the event that you need to get propelled, you can likewise open up the undertaking record for a particular stage by opening the required Xcode or Android Eclipse venture in stages/PLATFORM inside the base of your task. At that point, you can fabricate and test from inside the stage particular IDE.
When it comes to publishing/running our projects the Ionic CLI, by default, tests our codebase for transpiration errors/warnings such as:
Despite the fact that it’s baffling to see the framework terminal showing CLI blunders when endeavoring to assemble/run ionic undertakings it’s a gigantic help over the long haul.
Thus, we can include the – verbose banner to perceive what is going on at each phase of an ionic form process like so:
ionic Cordova build ios –prod –verbose
This is useful where we might encounter build related errors as a result of software environment-related issues rather than problems with the code we have written.
Posted By :Pace Wisdom