deps: update temp-write to v5

This commit is contained in:
Antoine du Hamel 2021-06-29 16:33:05 +02:00
parent 2a15122881
commit d01422937e
2 changed files with 13 additions and 23 deletions

View file

@ -126,8 +126,8 @@
"size-limit": "4.5.6",
"stringify-object": "3.3.0",
"symbol-es6": "^0.1.2",
"temp-write": "3.4.0",
"tar": "^6.1.0",
"temp-write": "^5.0.0",
"terser": "^5.7.0",
"tinyify": "3.0.0",
"tsd": "^0.11.0",

View file

@ -1,9 +1,19 @@
/* global browser, expect, capabilities */
const http = require('http')
const tempWrite = require('temp-write')
const { Writable } = require('stream')
const { supportsChooseFile } = require('../utils')
const tempWrite = import('temp-write')
async function make1kBFile () {
const size = 1024
const content = Buffer.allocUnsafe(size)
for (let i = 0; i < size; i++) {
content[i] = Math.floor(Math.random() * 255)
}
return { path: await (await tempWrite).default(content), content }
}
const devNull = () => Writable({
write (chunk, enc, cb) {
cb()
@ -38,18 +48,7 @@ describe.skip('XHRUpload with `limit`', () => {
})
it('should start counting progress for all files', async () => {
const files = [
makeFile(1000),
makeFile(1000),
makeFile(1000),
makeFile(1000),
makeFile(1000),
makeFile(1000),
makeFile(1000),
makeFile(1000),
makeFile(1000),
makeFile(1000),
]
const files = await Promise.all(Array.from({ length: 10 }, make1kBFile))
const endpoint = `http://localhost:${server.address().port}`
await browser.execute((endpoint) => {
@ -87,12 +86,3 @@ describe.skip('XHRUpload with `limit`', () => {
expect(status.complete).to.be.equal(2)
})
})
function makeFile (size) {
const content = Buffer.allocUnsafe(size)
for (let i = 0; i < size; i++) {
content[i] = Math.floor(Math.random() * 255)
}
return { path: tempWrite.sync(content), content }
}