codenotary/immudb

Tests improvements: Better check for errors

开放

#1,435 创建于 2022年10月26日

 (3 条评论) (0 个反应) (0 位负责人)Go (371 个派生)auto 404
enhancementgood first issue

仓库指标

星标
 (8,999 个星标)
PR 合并指标
 (PR 指标待抓取)

描述

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.

贡献者指南