mirror of
https://github.com/nodejs/node.git
synced 2026-11-27 17:52:27 -05:00
test: use assert.match instead of regexp.test
PR-URL: https://github.com/nodejs/node/pull/39928 Reviewed-By: Tobias Nießen <tniessen@tnie.de> Reviewed-By: Rich Trott <rtrott@gmail.com> Reviewed-By: Anto Aravinth <anto.aravinth.cse@gmail.com> Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de> Reviewed-By: Darshan Sen <raisinten@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Zijian Liu <lxxyxzj@gmail.com>
This commit is contained in:
98 files changed
+259
-259
No files matched your search
@@ -29,8 +29,8 @@ const checkRequest = (socket, server) => {
|
||||
result += chunk;
|
||||
}));
|
||||
socket.on('end', common.mustCall(() => {
|
||||
assert(expectedHeader.test(result));
|
||||
assert(expectedBody.test(result));
|
||||
assert.match(result, expectedHeader);
|
||||
assert.match(result, expectedBody);
|
||||
server.close();
|
||||
}));
|
||||
};
|
||||
@@ -112,7 +112,7 @@ function createServer() {
|
||||
const options = null;
|
||||
const socket = agent.createConnection(port, host, options);
|
||||
socket.on('error', common.mustCall((e) => {
|
||||
assert(expectCertError.test(e.toString()));
|
||||
assert.match(e.toString(), expectCertError);
|
||||
server.close();
|
||||
}));
|
||||
}));
|
||||
@@ -127,7 +127,7 @@ function createServer() {
|
||||
const options = undefined;
|
||||
const socket = agent.createConnection(port, host, options);
|
||||
socket.on('error', common.mustCall((e) => {
|
||||
assert(expectCertError.test(e.toString()));
|
||||
assert.match(e.toString(), expectCertError);
|
||||
server.close();
|
||||
}));
|
||||
}));
|
||||
|
||||
Reference in new issue
Block a user