Black Sheep Code

Articles tagged "testing":

The tool I want to exist - an API mocking tool that generates mock data by observing real world usage.

Published:

Mocking API calls, particularly multiple interlinked calls can be cumbersome. I want a tool to do it for me.

React testing patterns: When making a change to a leaf component breaks tests further up the tree

Published:

A common pain point in testing React applications is when we make a change to a component that exists down the component tree, and this change causes breaks in multiple components that directly or indirectly consume this component. Here we outline some strategies for mitigating this problem.

The problem of testability in React

Published:

It seems like there are no perfect solutions for testing in React.

How to get started testing a React codebase that has no tests

Published:

You've inherited a React codebase that has no tests. You're having trouble with regressions and think that tests might help, but how do you get started?

A comprehensive guide to testing with Easy-Markdown-Editor

Published:

Easy Markdown Editor is a handy markdown editor with formatting keyboard shortcuts. This post outlines how to write tests for applications using it, using either Testing Library or Cypress.

Testing strategies for a Single Page Application as it relates to state management

Published:

The presence of state management is often what makes testing an Single Page Application difficult. Various approaches such as API mocking, dependency injection, component composition and error boundaries can help.

Black box contract testing - third party API mocking

Published:

We have an API that makes calls out to a third party - how do we test it? We can use .HAR files to configure a tool like Mockbin to act as the third party service.

Blackbox contract tests - Performance testing with Jest

Published:

We can use a tool called jest-timing-reporter to provide a performance diff in our Github pull request.

OpenAPI and contract tests with Jest

Published:

Using good ol' Jest to write some contract tests with our OpenAPI generated client SDK.

Using Postman and an OpenAPI spec for contract/blackbox tests

Published:

Syncing Postman with our Github repo, generating queries from our OpenAPI spec.

Postman and OpenAPI - Automating tests

Published:

Postman has an automated testing feature, but how well does it work?

The case for blackbox tests

Published:

Blackbox tests do not require knowledge of the implementation details - they're a 'how the consumer sees it' style of test.

Generating MSW mocks from an OpenAPI spec.

Published:

We're using msw-auto-mock to generate MSW mocks to test our React application.

Why I don't like API mocking as a necessary frontend testing strategy

Published:

A lot of state management frameworks recommend doing API mocking as the testing strategy. I think dependency injection is a better approach.

The case for splitting Cypress tests into multiple it blocks

Published:

Cypress recommends long running tests with lots of assertions. I argue that it would be helpful if we had granular visibility of the parts of the test.

Dependency injection when using redux.

Published:

An unconventional strategy to inject the behaviour of your state management in testing contexts