From 34fb84c313e00564484fa69b2c40ea45a257c636 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Hu=C3=A1ng=20J=C3=B9nli=C3=A0ng?= Date: Mon, 28 Mar 2022 10:02:25 -0400 Subject: [PATCH] add test case --- packages/babel-types/test/validators.js | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/packages/babel-types/test/validators.js b/packages/babel-types/test/validators.js index 1272cefe96ec..33e17852d818 100644 --- a/packages/babel-types/test/validators.js +++ b/packages/babel-types/test/validators.js @@ -266,6 +266,20 @@ describe("validators", function () { }); }); + describe("ClassDeclaration", () => { + it("returns true if node is a class heritage", function () { + const node = t.identifier("A"); + const parent = t.classDeclaration( + t.identifier("C"), + node, + t.classBody([]), + [], + ); + + expect(t.isReferenced(node, parent)).toBe(true); + }); + }); + describe("exports", function () { it("returns false for re-exports", function () { const node = t.identifier("foo");