Skip to content

Commit b766dab

Browse files
Trottitaloacasas
authored andcommitted
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 <[email protected]> Reviewed-By: James M Snell <[email protected]> Reviewed-By: Colin Ihrig <[email protected]> Reviewed-By: Sakthipriyan Vairamani <[email protected]> Reviewed-By: Luigi Pinca <[email protected]>
1 parent 266c41c commit b766dab

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

test/parallel/test-dgram-membership.js

+5-5
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ const setup = () => {
1414
const socket = setup();
1515
socket.close(common.mustCall(() => {
1616
assert.throws(() => { socket.addMembership(multicastAddress); },
17-
/Not running/);
17+
/^Error: Not running$/);
1818
}));
1919
}
2020

@@ -23,23 +23,23 @@ const setup = () => {
2323
const socket = setup();
2424
socket.close(common.mustCall(() => {
2525
assert.throws(() => { socket.dropMembership(multicastAddress); },
26-
/Not running/);
26+
/^Error: Not running$/);
2727
}));
2828
}
2929

3030
// addMembership() with no argument should throw
3131
{
3232
const socket = setup();
3333
assert.throws(() => { socket.addMembership(); },
34-
/multicast address must be specified/);
34+
/^Error: multicast address must be specified$/);
3535
socket.close();
3636
}
3737

3838
// dropMembership() with no argument should throw
3939
{
4040
const socket = setup();
4141
assert.throws(() => { socket.dropMembership(); },
42-
/multicast address must be specified/);
42+
/^Error: multicast address must be specified$/);
4343
socket.close();
4444
}
4545

@@ -69,7 +69,7 @@ const setup = () => {
6969
const socket = setup();
7070
assert.throws(
7171
() => { socket.dropMembership(multicastAddress); },
72-
/EADDRNOTAVAIL/
72+
/^Error: dropMembership EADDRNOTAVAIL$/
7373
);
7474
socket.close();
7575
}

0 commit comments

Comments
 (0)