fix: ok statusCode can be 200..299 (#7919)

This commit is contained in:
Khafra
2022-05-14 12:38:05 -04:00
committed by GitHub
parent b1a3aa97ea
commit d1504f2ae1
2 changed files with 16 additions and 1 deletions

View File

@@ -253,6 +253,21 @@ test('postEcho', async () => {
expect(await api.post('/postEcho', { body: { foo: 'bar' } })).toStrictEqual({ foo: 'bar' });
});
test('201 status code', async () => {
mockPool
.intercept({
path: genPath('/postNon200StatusCode'),
method: 'POST',
})
.reply((t) => ({
data: t.body!,
statusCode: 201,
responseOptions,
}));
expect(await api.post('/postNon200StatusCode', { body: { foo: 'bar' } })).toStrictEqual({ foo: 'bar' });
});
test('Old Message Delete Edge-Case: Old message', async () => {
mockPool
.intercept({