-
Notifications
You must be signed in to change notification settings - Fork 36
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: remove unuse "stream-wormhole" deps #63
Changes from 2 commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
This file was deleted.
This file was deleted.
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,9 @@ | ||
'use strict'; | ||
|
||
const assert = require('assert'); | ||
const Agent = require('http').Agent; | ||
const assert = require('node:assert'); | ||
const { Agent } = require('node:http'); | ||
const path = require('node:path'); | ||
const fs = require('node:fs/promises'); | ||
const formstream = require('formstream'); | ||
const urllib = require('urllib'); | ||
const path = require('path'); | ||
const fs = require('fs').promises; | ||
const mock = require('egg-mock'); | ||
|
||
function sleep(ms) { | ||
|
@@ -101,7 +99,7 @@ describe('test/multipart.test.js', () => { | |
stream: form, | ||
}); | ||
|
||
assert(res.data.toString().includes('ENOENT:')); | ||
assert.match(res.data.toString(), /ENOENT:/); | ||
}); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Refine error handling to ensure specific error types are caught. Consider using |
||
|
||
it('should auto consumed file stream on error throw', async () => { | ||
|
@@ -569,8 +567,7 @@ describe('test/multipart.test.js', () => { | |
|
||
it('should file hit limits fileSize', async () => { | ||
const form = formstream(); | ||
form.buffer('file', Buffer.alloc(1024 * 1024 * 100), 'foo.js'); | ||
|
||
form.buffer('file', Buffer.from('a'.repeat(1024 * 1024 * 100)), 'foo.js'); | ||
const headers = form.headers(); | ||
const url = host + '/upload/async?fileSize=100000'; | ||
const result = await urllib.request(url, { | ||
|
@@ -668,11 +665,11 @@ describe('test/multipart.test.js', () => { | |
}); | ||
|
||
const data = res.data; | ||
assert(res.status === 200); | ||
assert.equal(res.status, 200); | ||
assert(data.url); | ||
|
||
app.expectLog('nodejs.MultipartFileTooLargeError: Request file too large', 'errorLogger'); | ||
app.expectLog(/filename: ['"]not-handle-error-event.js['"]/, 'errorLogger'); | ||
app.expectLog('nodejs.MultipartFileTooLargeError: Request file too large', 'coreLogger'); | ||
app.expectLog(/filename: ['"]not-handle-error-event.js['"]/, 'coreLogger'); | ||
}); | ||
|
||
it('should ignore stream next errors after limit event fire', async () => { | ||
|
@@ -693,8 +690,8 @@ describe('test/multipart.test.js', () => { | |
assert(res.status === 200); | ||
assert(data.url); | ||
|
||
app.expectLog('nodejs.MultipartFileTooLargeError: Request file too large', 'errorLogger'); | ||
app.expectLog(/filename: ['"]not-handle-error-event-and-mock-stream-error.js['"]/, 'errorLogger'); | ||
app.expectLog('nodejs.MultipartFileTooLargeError: Request file too large', 'coreLogger'); | ||
app.expectLog(/filename: ['"]not-handle-error-event-and-mock-stream-error.js['"]/, 'coreLogger'); | ||
}); | ||
}); | ||
}); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Grammar correction needed in the deprecated section.
Committable suggestion
Tools
LanguageTool