[ci] format

This commit is contained in:
matthewp 2022-07-22 19:24:58 +00:00 committed by fredkbot
parent 4ca6a0933d
commit 4392083cca
4 changed files with 13 additions and 14 deletions

View file

@ -14,7 +14,7 @@ function createRequestFromNodeRequest(req: IncomingMessage, body?: string): Requ
let request = new Request(url, {
method: req.method || 'GET',
headers: new Headers(entries),
body
body,
});
if (req.socket?.remoteAddress) {
Reflect.set(request, clientAddressSymbol, req.socket.remoteAddress);
@ -30,7 +30,7 @@ export class NodeApp extends App {
if ('on' in req) {
let body: string | undefined = undefined;
let reqBodyComplete = new Promise((resolve, reject) => {
req.on('data', d => {
req.on('data', (d) => {
if (body === undefined) {
body = '';
}
@ -43,7 +43,7 @@ export class NodeApp extends App {
req.on('end', () => {
resolve(body);
});
req.on('error', err => {
req.on('error', (err) => {
reject(err);
});
});

View file

@ -2,7 +2,6 @@ import nodejs from '../dist/index.js';
import { loadFixture, createRequestAndResponse, toPromise } from './test-utils.js';
import { expect } from 'chai';
describe('API routes', () => {
/** @type {import('./test-utils').Fixture} */
let fixture;
@ -23,7 +22,7 @@ describe('API routes', () => {
let { req, res, done } = createRequestAndResponse({
method: 'POST',
url: '/recipes'
url: '/recipes',
});
handler(req, res);

View file

@ -23,7 +23,7 @@ export function createRequestAndResponse(reqOptions) {
let res = httpMocks.createResponse({
eventEmitter: EventEmitter,
req
req,
});
let done = toPromise(res);
@ -32,7 +32,7 @@ export function createRequestAndResponse(reqOptions) {
}
export function toPromise(res) {
return new Promise(resolve => {
return new Promise((resolve) => {
res.on('end', () => {
let chunks = res._getChunks();
resolve(chunks);