Skip to content

Commit

Permalink
Revert "Fix tests"
Browse files Browse the repository at this point in the history
This reverts commit bfbd102.
  • Loading branch information
dangeredwolf committed Aug 6, 2024
1 parent f08274c commit 054dbd6
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion src/realms/twitter/routes/status.ts
Original file line number Diff line number Diff line change
Expand Up @@ -134,6 +134,6 @@ export const statusRequest = async (c: Context) => {
Obviously we just need to redirect to the status directly.*/
console.log('Matched human UA', userAgent);

return c.redirect(`${baseUrl}/${handle || 'i'}/status/${id?.match(/\d{2,20}/)?.[0]}?mx=1`, 302);
return c.redirect(`${baseUrl}/${handle || 'i'}/status/${id?.match(/\d{2,20}/)?.[0]}`, 302);
}
};
8 changes: 4 additions & 4 deletions test/worker.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ test('Status redirect human', async () => {
})
);
expect(result.status).toEqual(302);
expect(result.headers.get('location')).toEqual('https://twitter.com/jack/status/20?mx=1');
expect(result.headers.get('location')).toEqual('https://twitter.com/jack/status/20');
});

test('Status redirect human trailing slash', async () => {
Expand All @@ -66,7 +66,7 @@ test('Status redirect human trailing slash', async () => {
})
);
expect(result.status).toEqual(302);
expect(result.headers.get('location')).toEqual('https://twitter.com/jack/status/20?mx=1');
expect(result.headers.get('location')).toEqual('https://twitter.com/jack/status/20');
});

test('Status redirect human custom base redirect', async () => {
Expand All @@ -80,7 +80,7 @@ test('Status redirect human custom base redirect', async () => {
})
);
expect(result.status).toEqual(302);
expect(result.headers.get('location')).toEqual('https://nitter.net/jack/status/20?mx=1');
expect(result.headers.get('location')).toEqual('https://nitter.net/jack/status/20');
});

test('Twitter moment redirect', async () => {
Expand All @@ -94,7 +94,7 @@ test('Twitter moment redirect', async () => {
)
);
expect(result.status).toEqual(302);
expect(result.headers.get('location')).toEqual(`${twitterBaseUrl}/i/events/1572638642127966214?mx=1`);
expect(result.headers.get('location')).toEqual(`${twitterBaseUrl}/i/events/1572638642127966214`);
});

test('Status response robot', async () => {
Expand Down

0 comments on commit 054dbd6

Please sign in to comment.