From d6f39b0aab5521a8b118b466a515fd6eb0b9f65e Mon Sep 17 00:00:00 2001 From: Blake Embrey Date: Wed, 2 Oct 2024 15:21:10 -0700 Subject: [PATCH] Fix tests for old node --- test/serialize.js | 46 +++++++++++++++++++++------------------------- 1 file changed, 21 insertions(+), 25 deletions(-) diff --git a/test/serialize.js b/test/serialize.js index 332f7cd..be84595 100644 --- a/test/serialize.js +++ b/test/serialize.js @@ -36,8 +36,8 @@ describe('cookie.serialize(name, value)', function () { 'foo7bar', ]; - validNames.forEach((name) => { - assert.equal(cookie.serialize(name, 'baz'), `${name}=baz`, `Expected serialized value for name: "${name}"`); + validNames.forEach(function (name) { + assert.equal(cookie.serialize(name, 'baz'), name + '=baz'); }); }); @@ -52,7 +52,6 @@ describe('cookie.serialize(name, value)', function () { 'foo[foo]', 'foo?foo', 'foo:foo', - 'foo!foo', 'foo{foo}', 'foo foo', 'foo\tfoo', @@ -60,11 +59,11 @@ describe('cookie.serialize(name, value)', function () { 'foo' ]; - invalidPaths.forEach((path) => { + invalidPaths.forEach(function (path) { assert.throws( - cookie.serialize.bind(cookie, 'foo', 'bar', { path }), + cookie.serialize.bind(cookie, 'foo', 'bar', { path: path }), /option path is invalid/, - `Expected an error for invalid path: "${path}"` + 'Expected an error for invalid path: ' + path ); }); });