test
This commit is contained in:
parent
7846686757
commit
f2900525d5
@ -11,13 +11,16 @@ const IMAGE = readFileSync(resolve(__dirname, '../../pictures/image2.png'));
|
|||||||
|
|
||||||
describe('Worker auth', () => {
|
describe('Worker auth', () => {
|
||||||
it('rejects request with no auth header', async () => {
|
it('rejects request with no auth header', async () => {
|
||||||
const res = await fetch(`${WORKER_URL}/presign?filename=image2.png`);
|
const res = await fetch(`${WORKER_URL}/presign?filename=image2.png`, {
|
||||||
|
signal: AbortSignal.timeout(5000),
|
||||||
|
});
|
||||||
expect(res.status).toBe(401);
|
expect(res.status).toBe(401);
|
||||||
});
|
});
|
||||||
|
|
||||||
it('rejects request with wrong secret', async () => {
|
it('rejects request with wrong secret', async () => {
|
||||||
const res = await fetch(`${WORKER_URL}/presign?filename=image2.png`, {
|
const res = await fetch(`${WORKER_URL}/presign?filename=image2.png`, {
|
||||||
headers: { Authorization: 'Bearer wrong-secret' },
|
headers: { Authorization: 'Bearer wrong-secret' },
|
||||||
|
signal: AbortSignal.timeout(5000),
|
||||||
});
|
});
|
||||||
expect(res.status).toBe(401);
|
expect(res.status).toBe(401);
|
||||||
});
|
});
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user