Meat minimalism

Meat minimalism, a term I first heard coined by my father, is the practice of cutting out a large percentage of animal products without making one’s life miserable. It’s a practice that I adopted a few years ago and has been sustainable for me where vegetarianism and veganism weren’t. I’d like to make my case for the practice and list the benefits. Substitute as much as possible I avoid the animal products I don’t enjoy in a bizzare Marie Kondo dietary program way. [Read More]

A working typescript integration test for Firebase

There is a lack of documentation on typescript with firebase functions. Below is a working integration test, adapted from the nodejs documentation Note: The process part will depend on your OS. import assert = require('assert'); import chai from 'chai'; import chaiHttp from 'chai-http'; import 'mocha'; chai.use(chaiHttp); // let childProcessPromise: ChildProcessPromise<PromiseResult<string>>; describe('profile', function() { before(() => { // need to kill process // what OS will build server run? // childProcessPromise = exec(`firebase emulators:start`); }); after(async () => { // await childProcessPromise; }); it('should get a profile', function () { return chai. [Read More]

The missed benefit of unit testing

When it comes to unit testing, many developers understand that they “should” but the desire for fast progress often gets in the way. The excuses in our head are: For a codebase without tests: Adding tests would be nice, but adding them takes too much time. Especially the first one when a testing library is getting figured out. In addition to unit tests, I’ll want integration tests, too.. Other members of my team do not see the benefit of testing. [Read More]

Bugs in Hackerrank during an interview

Had this come up during an assessment from hackerrank… After running their cucumber tests in the browser, the console output was garbled and incomprehensible. My next thought, was to run them locally. They flat out failed on my machine. This line is used for calling the cucumber tests: <argument>java -jar ${project.build.directory}/${project.build.finalName}.jar</argument> When it reaches this line in runner.js: this.child = spawn(command, { it fails due to failing to normalize paths. [Read More]

Offline unit testing Google Cloud Functions in Typescript

The problem Google’s documentation on Firebase is primarily in JavaScript, but we want to use TypeScript. That means we lose a lot of the freedom that node.js provides (not really a bad thing, though, as that freedom lets us create absolutely unmaintainable code) So what do we need to do? The obvious answer is mocking, but there are some barriers before we can get there. Primarily, jest itself doesn’t handle compiling typescript. [Read More]