From 60cf5ec8d7f984d75999264f6fa3406436c5f526 Mon Sep 17 00:00:00 2001 From: KernelDeimos Date: Fri, 20 Sep 2024 15:52:02 -0400 Subject: [PATCH] test: update remaining tap asserts After the previous changes there were a few lingering asserts that didn't match the names in the newest version of tap. These were relatively trivial to fix, although interestingly the meaning of the 'includes' synonym changed at some point from "match" to "has"; these tests were written at the time "includes" meant "match". --- test/cli.test.js | 2 +- test/main.test.js | 4 ++-- test/process-env-port.test.js | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/test/cli.test.js b/test/cli.test.js index 3520f442..cecc593c 100644 --- a/test/cli.test.js +++ b/test/cli.test.js @@ -34,7 +34,7 @@ function checkServerIsRunning(url, msg, t, _cb) { } function tearDown(ps, t) { - t.tearDown(() => { + t.teardown(() => { ps.kill('SIGTERM'); }); } diff --git a/test/main.test.js b/test/main.test.js index df4c65b8..ebff0563 100644 --- a/test/main.test.js +++ b/test/main.test.js @@ -57,8 +57,8 @@ test('http-server main', (t) => { requestAsync("http://localhost:8080/").then(res => { t.ok(res); t.equal(res.statusCode, 200); - t.includes(res.body, './file'); - t.includes(res.body, './canYouSeeMe'); + t.match(res.body, './file'); + t.match(res.body, './canYouSeeMe'); // Custom headers t.equal(res.headers['access-control-allow-origin'], '*'); diff --git a/test/process-env-port.test.js b/test/process-env-port.test.js index e565a6fe..ad2da5c2 100644 --- a/test/process-env-port.test.js +++ b/test/process-env-port.test.js @@ -40,7 +40,7 @@ function startServer(url, port, t) { }); } else { ecstatic.on('exit', (evt) => { - t.notEqual(evt.code, 0, 'err:Running on invalid port not allowed'); + t.not(evt.code, 0, 'err:Running on invalid port not allowed'); }); } }