From 888ca4a65632cb66b63aaa395c983d4bf2a5aa8c Mon Sep 17 00:00:00 2001 From: Rich Trott Date: Sun, 5 Feb 2017 14:02:30 -0800 Subject: [PATCH] test: increase specificity in dgram test Expand error message checking to include the entire error string in test-dgram-membership. PR-URL: https://github.com/nodejs/node/pull/11187 Reviewed-By: Yuta Hiroto Reviewed-By: James M Snell Reviewed-By: Colin Ihrig Reviewed-By: Sakthipriyan Vairamani Reviewed-By: Luigi Pinca --- test/parallel/test-dgram-membership.js | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/test/parallel/test-dgram-membership.js b/test/parallel/test-dgram-membership.js index 87807f13fa5f23..1543b9043f7738 100644 --- a/test/parallel/test-dgram-membership.js +++ b/test/parallel/test-dgram-membership.js @@ -12,7 +12,7 @@ const setup = dgram.createSocket.bind(dgram, {type: 'udp4', reuseAddr: true}); const socket = setup(); socket.close(common.mustCall(() => { assert.throws(() => { socket.addMembership(multicastAddress); }, - /Not running/); + /^Error: Not running$/); })); } @@ -21,7 +21,7 @@ const setup = dgram.createSocket.bind(dgram, {type: 'udp4', reuseAddr: true}); const socket = setup(); socket.close(common.mustCall(() => { assert.throws(() => { socket.dropMembership(multicastAddress); }, - /Not running/); + /^Error: Not running$/); })); } @@ -29,7 +29,7 @@ const setup = dgram.createSocket.bind(dgram, {type: 'udp4', reuseAddr: true}); { const socket = setup(); assert.throws(() => { socket.addMembership(); }, - /multicast address must be specified/); + /^Error: multicast address must be specified$/); socket.close(); } @@ -37,7 +37,7 @@ const setup = dgram.createSocket.bind(dgram, {type: 'udp4', reuseAddr: true}); { 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 = dgram.createSocket.bind(dgram, {type: 'udp4', reuseAddr: true}); const socket = setup(); assert.throws( () => { socket.dropMembership(multicastAddress); }, - /EADDRNOTAVAIL/ + /^Error: dropMembership EADDRNOTAVAIL$/ ); socket.close(); }