-
Notifications
You must be signed in to change notification settings - Fork 29.6k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
test: allow tests to pass without internet
Currently when running the test without an internet connection there are two JavaScript test failures This commit moves the two JavaScript tests to test/internet. Backport-PR-URL: #17171 PR-URL: #16255 Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: James M Snell <jasnell@gmail.com>
- Loading branch information
1 parent
644989c
commit 6269ba3
Showing
2 changed files
with
37 additions
and
29 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
'use strict'; | ||
|
||
require('../common'); | ||
const assert = require('assert'); | ||
const dgram = require('dgram'); | ||
const multicastAddress = '224.0.0.114'; | ||
|
||
const setup = dgram.createSocket.bind(dgram, { type: 'udp4', reuseAddr: true }); | ||
|
||
// addMembership() with valid socket and multicast address should not throw | ||
{ | ||
const socket = setup(); | ||
assert.doesNotThrow(() => { socket.addMembership(multicastAddress); }); | ||
socket.close(); | ||
} | ||
|
||
// dropMembership() without previous addMembership should throw | ||
{ | ||
const socket = setup(); | ||
assert.throws( | ||
() => { socket.dropMembership(multicastAddress); }, | ||
/^Error: dropMembership EADDRNOTAVAIL$/ | ||
); | ||
socket.close(); | ||
} | ||
|
||
// dropMembership() after addMembership() should not throw | ||
{ | ||
const socket = setup(); | ||
assert.doesNotThrow( | ||
() => { | ||
socket.addMembership(multicastAddress); | ||
socket.dropMembership(multicastAddress); | ||
} | ||
); | ||
socket.close(); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters