[ci] format

This commit is contained in:
matthewp 2022-09-14 11:59:49 +00:00 committed by fredkbot
parent cf8a7e933d
commit a36d51d433
3 changed files with 7 additions and 5 deletions

View file

@ -217,7 +217,7 @@ async function handleRequest(
if (!(req.method === 'GET' || req.method === 'HEAD')) {
let bytes: Uint8Array[] = [];
await new Promise((resolve) => {
req.on('data', part => {
req.on('data', (part) => {
bytes.push(part);
});
req.on('end', resolve);

View file

@ -2,7 +2,7 @@ import { expect } from 'chai';
import * as cheerio from 'cheerio';
import { loadFixture } from './test-utils.js';
import * as fs from 'fs';
import { FormData, File } from 'node-fetch'
import { FormData, File } from 'node-fetch';
describe('API routes', () => {
/** @type {import('./test-utils').Fixture} */

View file

@ -57,13 +57,15 @@ describe('API routes in SSR', () => {
it('Can be passed binary data from multipart formdata', async () => {
const formData = new FormData();
const raw = await fs.promises.readFile(new URL('./fixtures/ssr-api-route/src/images/penguin.jpg', import.meta.url));
const raw = await fs.promises.readFile(
new URL('./fixtures/ssr-api-route/src/images/penguin.jpg', import.meta.url)
);
const file = new File([raw], 'penguin.jpg', { type: 'text/jpg' });
formData.set('file', file, 'penguin.jpg');
const res = await fixture.fetch('/binary', {
method: 'POST',
body: formData
body: formData,
});
expect(res.status).to.equal(200);