mirror of
https://github.com/transloadit/uppy.git
synced 2026-07-18 00:55:35 +00:00
ci: test Companion with Node.js 16.x (#3273)
This commit is contained in:
parent
01158d7445
commit
2eee086545
3 changed files with 11 additions and 3 deletions
2
.github/workflows/companion.yml
vendored
2
.github/workflows/companion.yml
vendored
|
|
@ -7,7 +7,7 @@ jobs:
|
|||
runs-on: ubuntu-latest
|
||||
strategy:
|
||||
matrix:
|
||||
node-version: [10.20.1, 12.x, 14.x]
|
||||
node-version: [10.20.1, 12.x, 14.x, 16.x]
|
||||
steps:
|
||||
- name: Checkout sources
|
||||
uses: actions/checkout@v2
|
||||
|
|
|
|||
|
|
@ -241,7 +241,15 @@ class Uploader {
|
|||
* @param {Function} callback
|
||||
*/
|
||||
onSocketReady (callback) {
|
||||
emitter().once(`connection:${this.token}`, () => callback())
|
||||
/** @type {any} */ // WriteStream.pending was added in Node.js 11.2.0
|
||||
const stream = this.writeStream
|
||||
if (stream.pending) {
|
||||
let connected = false
|
||||
emitter().once(`connection:${this.token}`, () => { if (stream.pending) connected = true; else callback() })
|
||||
this.writeStream.once('ready', () => connected && callback())
|
||||
} else {
|
||||
emitter().once(`connection:${this.token}`, () => callback())
|
||||
}
|
||||
logger.debug('waiting for connection', 'uploader.socket.wait', this.shortToken)
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
/* global jest:false, test:false, expect:false, describe:false */
|
||||
'use strict'
|
||||
|
||||
jest.mock('tus-js-client')
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue