refactor: tsify net module (#23618)

This commit is contained in:
Jeremy Apthorp 2020-05-18 10:22:48 -07:00 committed by GitHub
parent 8879a3db58
commit 7e841ceb5c
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 121 additions and 54 deletions

View file

@ -1208,7 +1208,7 @@ describe('net module', () => {
response.end();
});
const netRequest = net.request({ url: serverUrl, method: 'POST' });
expect(netRequest.getUploadProgress()).to.deep.equal({ active: false });
expect(netRequest.getUploadProgress()).to.have.property('active', false);
netRequest.end(Buffer.from('hello'));
const [position, total] = await emittedOnce(netRequest, 'upload-progress');
expect(netRequest.getUploadProgress()).to.deep.equal({ active: true, started: true, current: position, total });