Skip to content

Commit

Permalink
test: increase specificity in dgram test
Browse files Browse the repository at this point in the history
Expand error message checking to include the entire error string in
test-dgram-membership.

PR-URL: nodejs#11187
Reviewed-By: Yuta Hiroto <hello@about-hiroppy.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Sakthipriyan Vairamani <thechargingvolcano@gmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
  • Loading branch information
Trott authored and italoacasas committed Feb 9, 2017
1 parent 6a4e137 commit 343c041
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions test/parallel/test-dgram-membership.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ const setup = () => {
const socket = setup();
socket.close(common.mustCall(() => {
assert.throws(() => { socket.addMembership(multicastAddress); },
/Not running/);
/^Error: Not running$/);
}));
}

Expand All @@ -23,23 +23,23 @@ const setup = () => {
const socket = setup();
socket.close(common.mustCall(() => {
assert.throws(() => { socket.dropMembership(multicastAddress); },
/Not running/);
/^Error: Not running$/);
}));
}

// addMembership() with no argument should throw
{
const socket = setup();
assert.throws(() => { socket.addMembership(); },
/multicast address must be specified/);
/^Error: multicast address must be specified$/);
socket.close();
}

// dropMembership() with no argument should throw
{
const socket = setup();
assert.throws(() => { socket.dropMembership(); },
/multicast address must be specified/);
/^Error: multicast address must be specified$/);
socket.close();
}

Expand Down Expand Up @@ -69,7 +69,7 @@ const setup = () => {
const socket = setup();
assert.throws(
() => { socket.dropMembership(multicastAddress); },
/EADDRNOTAVAIL/
/^Error: dropMembership EADDRNOTAVAIL$/
);
socket.close();
}
Expand Down

0 comments on commit 343c041

Please sign in to comment.