From 3b4ca9e3141514ffac93bb7fef6c1329370df310 Mon Sep 17 00:00:00 2001 From: stonegray <7140974+stonegray@users.noreply.github.com> Date: Thu, 17 Dec 2020 23:50:10 -0500 Subject: [PATCH] Chore: Add test for valid non-string input (#463) --- tests/lib/parse.js | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/tests/lib/parse.js b/tests/lib/parse.js index b901c485..287d68cc 100644 --- a/tests/lib/parse.js +++ b/tests/lib/parse.js @@ -96,5 +96,14 @@ describe("parse()", () => { espree.parse("foo", Object.freeze({ ecmaFeatures: Object.freeze({}) })); }); + it("Cast valid non-string input", () => { + const str = "var foo = bar;"; + + assert.deepStrictEqual( + espree.parse(Buffer.from(str)), + espree.parse(str) + ); + }); + }); });