codenotary/immudb

Tests improvements: Better check for errors

Ouverte

#1 435 ouverte le 26 oct. 2022

 (3 commentaires) (0 réaction) (0 personne assignée)Go (371 forks)auto 404
enhancementgood first issue

Métriques du dépôt

Stars
 (8 999 étoiles)
Métriques de merge PR
 (Merge moyen 5j 15h) (18 PRs mergées en 30 j)

Description

What would you like to be added or enhanced

In many tests we're using require.Error(t, err) which only checks if the error happened without checking if the error is actually expected.

We should add more detailed error check, either by using require.ErrorIs or require.ErrorContains assertions.

Why is this needed

When expecting an error it is necessary to ensure the returned error is what was expected. It may turn out that in some cases the error checked by the test is not what it should be.

Guide contributeur