Run react-script tests without watch

Oh, man! I’m so happy that I’m still sane. This error was about to drive me crazy.

Here’s the back story - we have about 120 repositories with a lot of exercises and tests. This is nigh on impossible to maintain by hand, so we have written scripts to verify the integrity of each repository. Each script is verifying that installation, linting, and testing works as expected.

The whole thing is built-in bash scripts and for the most part, works just fine. It’s quite rewarding to have it checked automatically, read about it here

But the repositories that have been created with create-react-app have caused problems from day one. They work just fine when we use them normally, but in the script, it’s flaky at best and just hangs at worst.

But. Now. I’ve. Found. A. Solution.

More problem

React-Scripts and Jest

When...

Read More

Next.JS Error: No router instance found

I ran into a stupid problem I created for myself. And then I solved and that made me realize a thing about Next.JS and the server side rendering features of this framework.

I wanted to share my failures and solution to the problems I created here.

I have a page that is server-side rendered, since I’m the getServerSideProps.

One of the components on the page, reach out and grabs the router:

import { useRouter } from 'next/router'; const Header = () => { const router = useRouter(); } 

And I then added a click-handler like this:

<div onClick={router.push('/')}> ...stuff...
      
Read More

Uploading pictures to Firebase in React Native

It was quite some times since I wrote a programming related blog post - but now the time has come (and my programming output is poured at the Salt protips blog nowadays)

I’ve ventured a bit into React Native development and found it very enjoyable, especially in combination with Firebase stuff. But I had a really hard time finding a good example of how to upload files from my phone to the Storage services using Expo. I found this but I didn’t find it easy to follow as all of the code is in one single file.

So I took the original code and refactored it a tiny bit for better readability. My code is found here and in the post I’ll walk through some of the things that made me look twice.

Setup

The setup was plain and simple by...

Read More

Some questions about estimation and plannning

One of the most amazing things about my current job as a teacher and “head master” at Salt is to see amazing people take my material and make something more amazing with it. Or when see people start to venture down avenues that helped me (in this case agile, lean and no estimates) so much.

I got a question from Øyvind Ege - a brilliant developer from a class last spring/summer. And with his permission I will here publish his question and my response.

I hope you find it useful.

The question

Hi Marcus! Øyvind here from the summer 2020 class. I was hoping you could answer some questions I had about Agile!

I have the pain and pleasure of being both the full-stack developer and “Product Owner” (I guess, at least I am charged with “estimating” and “writing the specifications”) of a greenfield project....

Read More

Formulation - the crucial (often missed) step of BDD

Very early in my agile journey, I stumbled over Behaviour Driven Development (in that exact blog post, in fact - Thanks Dan). And like many, I first thought of it as a more user-friendly way of writing tests.

But pretty soon (through the help of Specifcation By Example - Thanks Gojko) I realized that the true power comes from the shared understanding that stakeholders and delivery team can get from writing the specifications together, before we start, as examples/tests using concrete data.

I was hooked and Cucumber was my poison. A programming language for requirements. Executable specifications, I mean - come on! This is now 15 years ago and I still am a big fan of this way of working.

Hence I was really happy to see that two of my BDD-heroes (Gaspar and Seb) have come together (again) to write about the often...

Read More

Christmas greeting

This year has been a very strange one, for most of us. I thought I’d share a little Christmas Greeting.

For me personally, I’ve gone through one of the big personal crisis of my life that led to a sudden, and deep, fatigue syndrome. I am better but it takes longer that than I wanted and I still am fighting a lot of different symptoms of the sickness.

But there is hope. For all of us there is hope - we can do this. We can get through the pandemic, drepression and fear. I’m sure that we will make it - and I’m sure that we will come out stronger, wiser and probably learned a lot.

Before dragging y’all down into a hole of dispair I better get those Christmas Greetings out of the way, right?

  • All lovely collegues at Salt - what a crazy year. Thanks...
Read More

Marcus and the wall

The thing that I’ve feared but never thought would happen has come to me to.

I have come down with the fatigue syndrome and a depression to follow. This is something that has been building up over many years and bursted out fully after the spring that was very though on me.

It’s now in its fifth week and I’m going to take some kind of program at a clinic that is geared only to handle this type of problems.

I’ve gone mostly of grid. First three weeks was just me crying and sleeping, so I was not much use to anyone anyway. I’ll be keeping it like that (off-grid) for the foreseeable future until I know what I manage.

Lots of confusing feelings right now where I’ve lost all my confidence and self worth while at the same time feel very tired. Right now a single telephone call is...

Read More

Role Models - Lars Littorin - the senior consultant

I’ve started a little series of some (by far not all) of the people that have shaped me during my career as a consultant. The more I think back of the things they said, did, and taught me - the more I can see how I’m using their advice just about every week.

Today the turn has come to a colleague that I had at Cap Gemini - the first senior consultant that I worked with and someone that made a huge impact on me and my ways; Lars Littorin

A bit of trivia to start - Lars is probably one of the few people that I’ll mention here that have a blog post dedicated to them already; The Lars Principle. I’ll let that great wisdom stand by itself, in that post. Go read it - Lars has great things to say.

Lars and I met an...

Read More

Role models - Christian the developer

I’ve just started a series about a few a the people that have shaped, influenced, and affected me throughout my career. The reason I’m writing about this now is that I lately have had the opportunity to be a role model for other young developers - I notice that much of what I say and do comes from others; things I’m saying, manners I’ve picked up, approaches to code, development, and life in general.

I am, as the saying goes, standing on the shoulders of giants. For what they have done for me I’m very grateful and I wanted to show that gratitude here.

The first post was about Staffan - that showed me servant leadership and what a consultant is. Today it’s about Christian Forsberg, a rock ‘n roll developer.

I met Christian in 1998 when I started my first consultant/contractor job at one of...

Read More

Role models - Staffan the consultant

I have a great job! I get to work with a lot of young people and get to train developers in the early stages of their careers. It’s absolutely amazing to see people develop in these early steps of their career.

But it also creates a weird feeling for me - since I, to them, comes out like an old sage telling stories that are long-forgotten about how the web was when the world was forged. Back in 1996 and stuff. I feel both a bit like Gandalf - both in age, length, and how I’m addressed.

Gandalf

It’s scary. Because, if we’re going to be a bit more serious, I realize that I become a role model for some of them. How to behave, act, say, and think about our work. This is especially real when we talk about agile practices and techniques,...

Read More