(options, handler)
| 8 | import { formidable, json, octetstream, multipart, errors } from '../../src/index.js'; |
| 9 | |
| 10 | function createServer(options, handler) { |
| 11 | const app = new Koa(); |
| 12 | |
| 13 | app.use(async (ctx, next) => { |
| 14 | const form = formidable(options); |
| 15 | await handler(ctx, form); |
| 16 | await next(); |
| 17 | }); |
| 18 | |
| 19 | return app; |
| 20 | } |
| 21 | |
| 22 | function fromFixtures(...args) { |
| 23 | return join(process.cwd(), 'test', 'fixture', ...args); |
no test coverage detected
searching dependent graphs…