Skip to content

Commit

Permalink
integration
Browse files Browse the repository at this point in the history
  • Loading branch information
Kanahiro committed Jul 26, 2024
1 parent c152418 commit 09b95eb
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 4 deletions.
1 change: 0 additions & 1 deletion src/server/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -157,7 +157,6 @@ function initServer(options: InitServerOptions) {
return c.body('invalid stylejson', 400);

// path params
console.log(c.req.param('filename'));
const [_, ext] = c.req.param('filename').split('.');
if (!isSupportedFormat(ext)) return c.body('invalid format', 400);

Expand Down
6 changes: 3 additions & 3 deletions tests/integration.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@ describe('intergration test', () => {

test('GET /bbox', async () => {
const res = await fetch(
'http://localhost:3000/bbox/100,30,150,60.png?url=file://localdata/style.json',
'http://localhost:3000/clip.png?bbox=100,30,150,60&url=file://localdata/style.json',
);
expect(res.status).toBe(200);
expect(res.headers.get('content-type')).toBe('image/png');
Expand All @@ -118,7 +118,7 @@ describe('intergration test', () => {
expect(pngsize.height).toBe(901); // shorter axis is calculated from bbox aspect ratio

const res2 = await fetch(
'http://localhost:3000/bbox/100,30,150,60.webp?url=file://localdata/style.json&quality=50&size=512',
'http://localhost:3000/clip.webp?bbox=100,30,150,60&url=file://localdata/style.json&quality=50&size=512',
);
expect(res2.headers.get('content-type')).toBe('image/webp');
const webp = new Uint8Array(await res2.arrayBuffer());
Expand All @@ -129,7 +129,7 @@ describe('intergration test', () => {

test('POST /bbox valid', async () => {
const res = await fetch(
'http://localhost:3000/bbox/100,30,150,60.png',
'http://localhost:3000/clip.png?bbox=100,30,150,60',
{
method: 'POST',
headers: { 'Content-Type': 'application/json' },
Expand Down

0 comments on commit 09b95eb

Please sign in to comment.