forwardemail / forwardemail/supertest

False-positive body diff's

Open
#571 1 comment 2 reactions 0 assignees View on GitHub
Dominant language
JavaScript
Stars
14.4k
Forks
782
PR merge metrics
No merged PRs in 30d

Description

When asserting JSON responses, the output is useless:
```
expected { data: { objects: { pageInfo: [Object], edges: [Array] } } } response body, got { data: { objects: { pageInfo: [Object], edges: [Array] } } }
```
The issue is that one of the nested fields is missing in the response but it's impossible to understand it from the output.

Code to reproduce:
```ts
request(app.getHttpServer())
.post('/graphql')
.send({ query, variables })
.expect(200)
.expect({
data: {
objects: {
pageInfo: {
endCursor: dateToBase64(obj.createdAt),
hasNextPage: false,
},
edges: [
{
cursor: dateToBase64(obj.createdAt),
node: omit(obj, ['createdAt', 'updatedAt']),
},
],
},
},
});
```

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.