From 661b48db6ff81e4f0a0391c397f00ef42a5a8d02 Mon Sep 17 00:00:00 2001 From: Blake Embrey Date: Tue, 8 Oct 2024 13:50:25 -0700 Subject: [PATCH] Update tests --- src/parse.spec.ts | 11 +++-------- 1 file changed, 3 insertions(+), 8 deletions(-) diff --git a/src/parse.spec.ts b/src/parse.spec.ts index 224aa3d..f1546f4 100644 --- a/src/parse.spec.ts +++ b/src/parse.spec.ts @@ -25,24 +25,19 @@ describe("cookie.parse(str)", function () { it("should URL-decode values", function () { expect(cookie.parse('foo="bar=123456789&name=Magic+Mouse"')).toEqual({ - foo: "bar=123456789&name=Magic+Mouse", + foo: '"bar=123456789&name=Magic+Mouse"', }); expect(cookie.parse("email=%20%22%2c%3b%2f")).toEqual({ email: ' ",;/' }); }); - it("should parse quoted values", function () { - expect(cookie.parse('foo="bar"')).toEqual({ foo: "bar" }); - expect(cookie.parse('foo=" a b c "')).toEqual({ foo: " a b c " }); - }); - it("should trim whitespace around key and value", function () { - expect(cookie.parse(' foo = "bar" ')).toEqual({ foo: "bar" }); + expect(cookie.parse(' foo = "bar" ')).toEqual({ foo: '"bar"' }); expect(cookie.parse(" foo = bar ; fizz = buzz ")).toEqual({ foo: "bar", fizz: "buzz", }); - expect(cookie.parse(' foo = " a b c " ')).toEqual({ foo: " a b c " }); + expect(cookie.parse(' foo = " a b c " ')).toEqual({ foo: '" a b c "' }); expect(cookie.parse(" = bar ")).toEqual({ "": "bar" }); expect(cookie.parse(" foo = ")).toEqual({ foo: "" }); expect(cookie.parse(" = ")).toEqual({ "": "" });