Sign in

GitHub pages allow us to host static sites from a repository. NextJS can be used as a static site generator. If we combine these two things and add some GitHub Action we get a React-based website that is easy to maintain, test, and host.

Prepare NextJS application

To generate static output we need to add next export command that creates a static version of the application.

"scripts": {
"dev": "next dev",
"build": "next build",
+ "export": "next export",
"start": "next start"
},

According to the NextJS documentation, there is a few caveats we must meet (e.g. we can not use getServerSideProps because of…


In this post, I will present some practical approaches to test an application that uses thunks from the redux-thunk library.

While browsing the web looking for ways and good practices to test redux state, many times I came across tests that check implementation details, not logic.

I don’t see much sense in such an approach, which will almost certainly be expensive to maintain — testing will become sensitive to change. What should be of interest to us is the effect of dispatched action on the state and possible check of selectors, if we have any.

Thunk implementations test

// Arrange
const store = mockStore(initialState);

//…

Łukasz

Software Developer — https://lukaszwozniak.dev/

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store