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 committed Feb 8, 2017
1 parent fcedd71 commit 73f219f
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions test/parallel/test-dgram-membership.js
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 73f219f

Please sign in to comment.