From fb4093393c7ee8fd72b82b142e7a538d27802815 Mon Sep 17 00:00:00 2001 From: Michael Brevard Date: Thu, 25 Jan 2024 15:58:20 +0200 Subject: [PATCH 1/2] test: prepare for additional utils --- test/index.test.ts | 40 +++++++++++++++++++++------------------- 1 file changed, 21 insertions(+), 19 deletions(-) diff --git a/test/index.test.ts b/test/index.test.ts index 0f07907..2447962 100644 --- a/test/index.test.ts +++ b/test/index.test.ts @@ -2,24 +2,26 @@ import { expect, it, describe } from "vitest"; import { extractJSDoc } from "../src"; describe("unjsdoc", () => { - it("should extract jsdoc", () => { - const jsdoc = extractJSDoc("../playground", "hasJSDoc"); - expect(jsdoc[0]).toMatchSnapshot(` - /** - * Test function with JSDoc - * @param test - * @param test2 - * @returns {number} - */`); - }); - it("should return null for non-existent jsdoc", () => { - const jsdoc = extractJSDoc("../playground", "noJSDoc"); - // eslint-disable-next-line unicorn/no-null - expect(jsdoc).toEqual(null); - }); - it("should return null for non-existent function", () => { - const jsdoc = extractJSDoc("../playground", "noFunction"); - // eslint-disable-next-line unicorn/no-null - expect(jsdoc).toEqual(null); + decribe("extractJSDoc", () => { + it("should extract jsdoc", () => { + const jsdoc = extractJSDoc("../playground", "hasJSDoc"); + expect(jsdoc[0]).toMatchSnapshot(` + /** + * Test function with JSDoc + * @param test + * @param test2 + * @returns {number} + */`); + }); + it("should return null for non-existent jsdoc", () => { + const jsdoc = extractJSDoc("../playground", "noJSDoc"); + // eslint-disable-next-line unicorn/no-null + expect(jsdoc).toEqual(null); + }); + it("should return null for non-existent function", () => { + const jsdoc = extractJSDoc("../playground", "noFunction"); + // eslint-disable-next-line unicorn/no-null + expect(jsdoc).toEqual(null); + }); }); }); From 8653f1240bce20c7d5e41fc24e9cf314b7064fd2 Mon Sep 17 00:00:00 2001 From: Michael Brevard Date: Thu, 25 Jan 2024 16:00:06 +0200 Subject: [PATCH 2/2] fix: typo --- test/index.test.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/index.test.ts b/test/index.test.ts index 2447962..e94f187 100644 --- a/test/index.test.ts +++ b/test/index.test.ts @@ -2,7 +2,7 @@ import { expect, it, describe } from "vitest"; import { extractJSDoc } from "../src"; describe("unjsdoc", () => { - decribe("extractJSDoc", () => { + describe("extractJSDoc", () => { it("should extract jsdoc", () => { const jsdoc = extractJSDoc("../playground", "hasJSDoc"); expect(jsdoc[0]).toMatchSnapshot(`