I have been writing unit tests like crazy for my muse Flutter app, in my own TDD-like fashion. Writing meaningful tests and watch them go from red to green is a great feeling for real. If you aren’t doing that yet, I highly recommended.
Flutter comes with an excellent testing library called — wait a minute — test. It has one of the most comprehensive set of assertion matchers I have ever seen.
- Want to test a type? Check.
- Want to test a future? Check.
- Want to test an error emitted by a stream? Check.
- Want to test if your method accidentally rings your neighbor’s door? Umm, well, you gotta do it yourself.
A lot of times you will need to create mocks to avoid side effects in your production database or APIs. Mockito is an awesome package for that. While Mockito works great for general-purpose mocking, I found cloud_firestore_mocks to be closer to the real deal in my testing.
I have used it so extensively in my own tests that I found myself wanting for more. cloud_firestore_mocks, as awesome as it is, does not yet support 100% of Firestore’s APIs. For example, it does not yet support
arrayContainsAny where query clause. Same is true for
I wanted it so much that I implemented it myself and sent a pull request to Ahn, cloud_firestore_mocks original author. The PR has been merged and the change will land on pub.dev soon. More power to open source!
If you are using Firestore with Flutter, check out cloud_firestore_mocks today and save yourself shit loads of time troubleshooting bugs later. Highly recommended.
The first-ever episode of a brand new podcast series called Dev Blabber. It’s an initiative that I came up with as part of the awesome Digital Futurists community, where a bunch of geeks, entrepreneurs and seasoned executives discuss technology and software like crazy.
There was a discussion last week in the Coding channel””one of many channels within the DF community, and the one that I lead””regarding the topic of our next knowledge-sharing session. 4 topics were proposed, ranging from React performance optimization to cybersecurity. But this one, about building open-core startups, rose as the clear winner. While deliberating the format of this session, I thought of making it in the form of a podcast. The idea was instantly liked by most in my channel, and thus was born Dev Blabber.
I hope you enjoy this episode, which being the first one is very loosely structured and borderline chaotic. At least it’s true to its ‘blabber’ name.
P.S. More details about DF and how to join are coming soon. Watch out!
I am blogging as much as I am tweeting these days. To keep the momentum going, I decided to link my blog with Twitter. I checked available plugins and instantly linked WP Twitter Auto Publish. It has a rating of 4.8 (with 130 ratings), which I think is great for a WordPress plugin. It’s both simple and sophisticated at the same time: pretty customizable, a lot of options. Posting of featured image along with post title/content has to be one of the best features.
I found one thing missing, though — the ability to automatically use post tags as tweet hashtags. Instead of writing to the developers, requesting them to add this feature and then waiting for a few days or weeks or months, I decided to hack plugin’s code myself. The result can be seen in my tweet generated by this post.
As the plugin is open-source, I have published my code changes to my GitHub. I have dropped a Slack message to the developer requesting him to merge.
P.S. WordPress plugin ecosystem is still based on SVN. Really?
So, what’s keeping me busy these days? It’s office work, of course. Working on quite a challenging and bigger project has its side-effects as well (working till late and missing daily fruit juice doses in my case). Other than that, I am enjoying the work as it has to do with web development, my area of interest.
Being a strong advocate of open-source and Linux, I read a lot of articles on these topics daily. And I hate when people use words like “switch”, “migrate”, etc. when referring to making the move from Windows to Linux. Why do people, who try to compel people to switch from Windows to Linux, forget that there is always an option called “dualbooting” and that Windows still has the astronomically largest market share? I really hope people use the word “dualboot” more when advocating the use of Linux to others. By the way, I am also writing an article highlighting this matter (Why Switch? Dualboot!), which I intend to share pretty soon.
Talking about Linux, the latest Ubuntu release (10.4; Lucid Lynx) has been getting good reviews from all around. I can hardly wait to get my hands on it. I am planning to install it on my home PC (the one currently in use by my Dad and sister).
Also, two of my good friends, Chandan Puggal (working at Aricent) and Amritpal Singh (working at Accenture) recently joined me in Gurgaon (my present work location). 🙂
Finally, I did mention it earlier also, but it really is a frustrating life without a proper Internet connection. (Looking upward) God, please me my EV-DO back. Amen.