Permalink
Browse files

test: increase specificity in dgram test

Expand error message checking to include the entire error string in
test-dgram-membership.

PR-URL: #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 5, 2017
1 parent 266c41c commit b766dab81c6c5643042ce362248a05ca6485e758
Showing with 5 additions and 5 deletions.
  1. +5 −5 test/parallel/test-dgram-membership.js
@@ -14,7 +14,7 @@ const setup = () => {
const socket = setup();
socket.close(common.mustCall(() => {
assert.throws(() => { socket.addMembership(multicastAddress); },
- /Not running/);
+ /^Error: Not running$/);
}));
}
@@ -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();
}
@@ -69,7 +69,7 @@ const setup = () => {
const socket = setup();
assert.throws(
() => { socket.dropMembership(multicastAddress); },
- /EADDRNOTAVAIL/
+ /^Error: dropMembership EADDRNOTAVAIL$/
);
socket.close();
}

0 comments on commit b766dab

Please sign in to comment.