feat: add net.online / net.isOnline() (#21004)

This commit is contained in:
Milan Burda 2020-10-21 04:55:06 +02:00 committed by GitHub
parent 1ef803d2ea
commit df1432a315
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
5 changed files with 47 additions and 1 deletions

View file

@ -1500,6 +1500,16 @@ describe('net module', () => {
});
});
describe('net.isOnline', () => {
it('getter returns boolean', () => {
expect(net.isOnline()).to.be.a('boolean');
});
it('property returns boolean', () => {
expect(net.online).to.be.a('boolean');
});
});
describe('Stability and performance', () => {
it('should free unreferenced, never-started request objects without crash', (done) => {
net.request('https://test');